Showing posts with label Handbook. Show all posts
Showing posts with label Handbook. Show all posts

Jun 24, 2023

MySQL DBA Hand Book

Connect MySQL DB: 

mysql> mysql -u root  --socket=/var/lib/mysql/mysql.sock -p

Enter password:_


Check Running Process List:

mysql> show full processlist \G


Create User: 

mysql> create user 'account_name'@'Ip_address or %' IDENTIFIED BY '**********';


Alter a User: 

mysql> alter user 'root'@'localhost' identified by 'Secure@123';


Grant Privilege's to the Mysql User: 

mysql> grant all privileges on *.* to account_name;

mysql> flush privileges;

mysql> grant create, select, insert on * . * to account_name@'%';

mysql> flush privileges;


Check Host Name: 
mysql> select @@host;


Check DB Version
mysql> select @@hostname;


Socket and Port Info
mysql> select @@port;
mysql> select @@socket;