In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
How to change the root password in Mysql5.6? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
1. After MySQL5.6 installation, it cannot be enabled normally
Compressed version of MySQL, after decompression in: my computer-> Properties-> Advanced-> Environment variables
Select PATH and add the path to the mysql bin folder after it (for example: C:\ Program Files\ MySQL\ MySQL Server 5.6\ bin)
Modify or add configuration in my-default.ini:
[mysqld] basedir=C:\ Program Files\ MySQL\ MySQL Server 5.6 (directory where mysql is located) datadir=C:\ Program Files\ MySQL\ MySQL Server 5.6\ data (directory where mysql is located) port = 3306
Run cmd as an administrator and enter mysqld-install
After the installation is successful, the service will be started. Continue to type: net start mysql in cmd, and the service will start successfully!
After the service starts successfully, you can log in. As shown in the figure, enter mysql-u root-p (no password for the first login, press enter directly), and log in successfully!
2. MySQL5.6 forgot the root password
First net stop mysql service, and switch to the task manager, there is something related to mysql, it is best to close the process.
Run the CMD command to change to the MySql installation bin directory and execute mysqld-skip-grant-tables (note that there is no semicolon after it)
Do not close this command line window and reopen a new command line window. Note that sometimes there is a warning, just ignore it.
Open a new cmd window again. Follow the above method to run to the bin directory, run the command: mysql-u root-p, prompt for the password, and enter directly
Execute the command:
Update mysql.user set password=PASSWORD ('root') where User='root'
Refresh execution: mysql > flush privileges
Close the window and log in
Third, create a user and give certain permissions (with select,delete,update,create,drop permissions)
Log in with a user with all permissions
Create a user:
Mysql > insert into mysql.user (Host,User,Password) values ("localhost", "test", password ("1234"))
Authorize the user: grant permission on database. * to user name @ login host identified by "password";
Refresh the system permission table: mysql > flush privileges
Example 1:
This is the answer to the question about how to change the root password in Mysql5.6 from mysql > grant select,update on testDB.* to test@localhost identified by '1234 accountabilityMySQL > flush privileges;. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.