MySQL

Basic use case of mySQL.

Install MySQL on linux

sudo apt install mysql-server

Create a new user

Connect to MySQL as root :

sudo mysql

Create new user and set a password

CREATE USER 'ayra'@'localhost' IDENTIFIED BY 'your_secure_password';

GRANT ALL PRIVILEGES ON . TO 'ayra'@'localhost' WITH GRANT OPTION;

FLUSH PRIVILEGES;

Leave the current session :

EXIT;

Connect with the new user :

mysql -u ayra -p

Check MySQL error logs :

cat /var/log/mysql/error.log

Change password :

sudo mysql

ALTER USER 'ayra'@'localhost' IDENTIFIED BY 'newPassword';

FLUSH PRIVILEGES;

Create a database :

create databases pickAname;

Last updated

Was this helpful?