mysqlでの基本的なアカウント操作
I have finashed mysql installation and need to change root password to “123456”
(original password is null)
cd ../mysql/bin/
mysqladmin -u root -p password 123456
click enter key if sytem request password.
confirm new password
mysql -u root -p
input password “123456” ,pressing enter, you can login mysql
add an user test and set it’s password as “123456”, only allow this user login mysql
from client 192.168.1.5, and user test has all permission on any database and tables.
grant all privileges on *.* to [email protected] identified by “123456”;
add an user test and set it’s password as “123456”, allow this user login mysql from
any client, and user test has all permission on any database and tables.
grant all privileges on *.* to test@’%’ identified by “123456”;
check current user
select user();
switch to mysql database
mysqlを使用する;
check all details about table user
選択する * from user \G;
check user,パスワード,host information of table user
select user,パスワード,host from user;
generate user “cc” and set it’s password as “123456” , only allow this user login mysql from
ローカルホスト.
create user ‘cc’@’localhost’ 「123456」で識別;
remove all users which only be allowed login mysql from localhost.
delete from mysql.user where user=’cc’ and host=’localhost’;