This question has been bothering me for two years:
In order to configure the parameters for undo in my.cnf to take effect, and to generate an undo file, use the command
/usr/bin/mysql_install_db--defaults-file=/etc/my.cnf--datadir=/dbfiles/data--basedir=/dbfiles/
Time-consuming reason is, do not look help, only know Baidu
After MySQL is initialized, change the root password:
ALTER USER ' root ' @ ' localhost ' identified by ' 11111 ';
After forgetting the password, change the root password: (MySQL with a high version, requires a minimum of 8 digits, and requires a combination of numbers, lowercase letters, uppercase letters, special characters)
Update user set Authentication_string=password (' 123a*fdf ') where user= ' root ' and host= ' localhost ';
Excerpt from: http://www.cnblogs.com/xxoome/p/6170579.html
To create a user:
#foo表示你要建立的用户名, the following 123 represents the password, #localhost限制在固定地址localhost登陆CREATE USER [email protected] identified by ' 123 ';
2. Authorization
GRANT privileges on Databasename.tablename to ' username ' @ ' host '
Description: Privileges-user's operation permissions, such as SELECT, INSERT, UPDATE, etc. Use all if you want to grant the permission;
DatabaseName-database name, tablename-table name, if you want to grant the user permission to operate on all databases and tables, the * representation is available *, such as *. *
For example:
GRANT insert,delete,update,select on Test.user to ' foo ' @ ' localhost ';
Flush privileges;
3. Setting and changing user passwords
Set PASSWORD for ' username ' @ ' host ' = PASSWORD (' newpassword ') #如果是当前登陆用户SET PASSWORD = PASSWORD ("NewPassword"); #例如: SET PASSWORD for ' foo ' @ '% ' = PASSWORD ("123456"); update Mysql.user set Password=password (' New password ') where user= "Phplamp" and host= "LocalHost";
MySQL init command and other commands