The document provides instructions for various commands in MySQL including creating a new user, adding an SQL file to a database, logging in as a user, showing current and all users, granting all permissions to a user, and changing a user's password. Key commands include CREATE USER, mysql, SELECT, SHOW, GRANT, and ALTER USER.
The document provides instructions for various commands in MySQL including creating a new user, adding an SQL file to a database, logging in as a user, showing current and all users, granting all permissions to a user, and changing a user's password. Key commands include CREATE USER, mysql, SELECT, SHOW, GRANT, and ALTER USER.
The document provides instructions for various commands in MySQL including creating a new user, adding an SQL file to a database, logging in as a user, showing current and all users, granting all permissions to a user, and changing a user's password. Key commands include CREATE USER, mysql, SELECT, SHOW, GRANT, and ALTER USER.
● Create / Add new user in mysql ● CREATE USER 'user'@'localhost' IDENTIFIED BY 'Password#12'; Add File in Database ● Add sql file in database ● mysql -u username -p database_name < file.sql User Login in MySQL ● User login in MySQL ● mysql -u root -p ● i.e mysql -u dev -p ● All MySQL User and Password ● Root User ● mysql -u root -p ● Personalhp11## ● Dev User ● mysql -u dev -p ● Nopass#123 ● User User ● mysql -u user -p ● LoraLora#123 Show All MySQL Users ● Show mysql users ● Select user from mysql.user; ● Show mySQL Users Details ● select * from mysql.user; Show Current User ● Show Current User ● Select user(); ● or, ● Select current_user(); ● Show Current Logged User ● Show Current Logged User ● SELECT user, host, db, command FROM information_schema.processlist; Give all Permission to User ● Gerant all Permission / Privileges to user ● GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost'; change password in mysql ● Change User Password in MySQL ● ALTER USER 'user-name'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD'; ● FLUSH PRIVILEGES; ●
● i.e ALTER USER 'user'@'localhost' IDENTIFIED BY 'LoraLora#123'; ●