In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The key to the installation is that the configuration after installation needs to be paid attention to. There are also a lot of articles on the Internet to summarize the problems I encountered in the installation process.
The first step is to download the macos version from the MySQL official website and then the installation prompts you to install step by step. After the installation is complete, there is an additional MySQL icon in the system preferences to open and discover that you can set whether the MySQL service is powered on and whether the MySQL service is turned on or off.
Step 2 after MySQL installation, it is very inconvenient to enter commands in the / usr/local/mysql directory, so it is best to create MySQL shortcut commands that can be used directly in the terminal. Of course, if you are willing to enter the full path command every time, you can ignore this step.
Open the terminal and enter the command sudo vim / etc/bashrc
Add the required shortcut commands to bashrc, for example
Alias mysqlstart='sudo / usr/local/mysql/support-files/mysql.server start'
Alias mysqlstop='sudo / usr/local/mysql/support-files/mysql.server stop'
Alias mysql='/usr/local/mysql/bin/mysql'
Alias mysqladmin='/usr/local/mysql/bin/mysqladmin'
You need to use "wq!" after editing Command forces the content to be saved.
The third step is to restart the terminal and then set the root account input command mysqladmin-u root password 123456 for MySQL
PS: possible error mysqladmin: connect to server at 'localhost' failed error:' Access denied for user 'root'@'localhost' (using password: NO)' when executing the above command
The idea is to start the service by ordering mysqld_safe to skip permission control and then log in and find the table that records the root user to change his password. The specific operations are as follows
Step 1: shut down the mysql service first
Step 2: open the terminal and enter the command sudo / usr/local/mysql/bin/mysqld_safe-- skip-grant-tables-- skip-networking &
-- skip-grant-tables does not start grant-tables (authorization table) and skips permission control.
-- skip-networking skips the TCP/IP protocol and accesses it locally only (this option is not required. You don't have to)
Step 3: keep the mysqld_safe enabled terminal and create a new terminal to enter the command mysql so that we can log in to the MySQL service directly.
Enter the SQL command to query the user information of MySQL
Select host,user,authentication_string from user
We just need to reset the password with the user name root to enter the SQL command.
Update user set authentication_string=PASSWORD ('123456') where user='root' and host='localhost'
New users or password changes need to refresh MySQL's system permissions table with flush privileges otherwise access will be denied. Another way is to restart the mysql server for the new settings to take effect. Enter the command flush privileges
Step 4: restart the MySQL service to open the terminal and enter the command mysql-uroot-p to log in successfully after entering the password you just set.
However, after I successfully logged in, show databases checked the database and reported an error You must reset your password using ALTER USER statement before executing.....
Step 1: SET PASSWORD = PASSWORD ('your new password')
Step 2: ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER
Step 3: flush privileges
Complete the above three steps and then log in and use the newly set password. Just enter the password as it is except for the red one.
At this point, mysql installation is complete.
To delete the MySQL, execute the following command in turn:
1 、 sudo rm / usr/local/mysql
2. Sudo rm-rf / usr/local/mysql*
3. Sudo rm-rf / Library/StartupItems/MySQLCOM
4. Sudo rm-rf / Library/PreferencePanes/My*
5. Vim / etc/hostconfig (and removed the line MYSQLCOM=-YES-)
6. Rm-rf ~ / Library/PreferencePanes/My*
7. Sudo rm-rf / Library/Receipts/mysql*
8. Sudo rm-rf / Library/Receipts/MySQL*
9. Sudo rm-rf / var/db/receipts/com.mysql.*
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.