#1. Stop the MySQL database
/etc/init.d/mysqld stop
#2. Execute the following command
Mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
#3. Log in to the MySQL database using root
Mysql-u Root MySQL
#4. Update the root password
mysql> UPDATE user SET Password=password (' NewPassword ') where user= ' root ';
#5. Refresh Permissions
mysql> FLUSH privileges;
#6. Quit MySQL
Mysql> quit
#7. Restart MySQL
/etc/init.d/mysqld restart
#8. Log back in to MySQL with the root user
Mysql-uroot-p
Enter Password: < Enter the newly set password newpassword>
MySQL Installation
Installation
RPM-IVH mysql-community-common-5.7.10-1.el6.x86_64.rpm--force--nodeps
RPM-IVH mysql-community-libs-5.7.10-1.el6.x86_64.rpm--force--nodeps
RPM-IVH mysql-community-client-5.7.10-1.el6.x86_64.rpm--force--nodeps
RPM-IVH mysql-community-server-5.7.10-1.el6.x86_64.rpm--force--nodeps
Start
Service mysqld Start
Stop it
Service Mysqld Stop
Start with Safe mode
Mysqld_safe--user=mysql--skip-grant-tables--skip-networking&
MySQL/** into MySQL interactive window *
UPDATE mysql.user SET authentication_string=password (' root ') where user= ' root ';
There is no password field in the Version user table after/*5.7 */
Flush privileges;
Exit
Exit Safe Mode:
Service Mysqld Stop
Modify the MySQL encoding while changing the password security level:
Vi/etc/my.cnf
# Reset Pass Level
Validate_password_policy = 0
Validate_password_length = 1
Validate_password_mixed_case_count = 0
Validate_password_number_count = 0
Validate_password_special_char_count = 0
Character_set_server=utf8
Default-storage-engine=innodb
Collation-server=utf8_general_ci
[Client]
Default-character-set=utf8
Start
Service mysqld Start
Join boot Start
Chkconfig mysqld on
Mysql-uroot-p
Execute SQL command
SET PASSWORD = PASSWORD (' root ');
Flush privileges;
Use MySQL;
Delete from user;
Authorized
GRANT all privileges on * * to ' root ' @ ' localhost ' identified by ' root ' with GRANT OPTION; local
GRANT all privileges on * * to ' root ' @ '% ' identified by ' root ' with GRANT OPTION;
Remote
Refresh Permissions
Flush privileges;
To create a hive connection user:
Mysql-uroot-proot
Create DATABASE hive DEFAULT CHARSET UTF8 COLLATE utf8_general_ci;
Authorizing local connections:
GRANT all privileges the hive.* to ' hive ' @ ' localhost ' identified by ' hive ' with GRANT OPTION;
Authorizing remote connections:
GRANT all privileges the hive.* to ' hive ' @ ' percent ' identified by ' hive ' with GRANT OPTION;
Submit:
FLUSH privileges;
Liunx under MySQL installation using