DEV Community

James Sessford
James Sessford

Posted on • Originally published at jamessessford.com on

MySQL

I always forget how to do some MySQL operations, especially the more modern ways to add users.I'm listing them here in hopes of either cementing the information because I've written it downor finding my own blog post when I have to search again :)

Depening on what environment you're working in, you could be accessing MySQL in a multitude of different ways.I'm currently using DBeaver & MyCLI on my Ubuntu laptop & HeidiSQL at work.

Databases

CREATE DATABASE mydatabase;
Enter fullscreen mode Exit fullscreen mode

Users

CREATE USER 'mydatabaseuser'@'%' IDENTIFIED WITH mysql_native_password BY 'mydatabasepassword';
Enter fullscreen mode Exit fullscreen mode

Permissions

GRANT ALL ON mydatabase.* to 'mydatabaseuser'@'%';
FLUSH PRIVILEGES;
Enter fullscreen mode Exit fullscreen mode

Access

mycli -u mydatabaseuser -p mydatabase
Enter fullscreen mode Exit fullscreen mode

I'll probably update this post with more MySQL things I remember that I forget as time goes on!

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay