1. Installation apt-get install mysql-server requires setting an account and password apt-get isntall mysql-client apt-get libmysqlclient-dev 2.sudo netstat -tap | grep mysql to check whether the installation is successful root@xyz:~# netstat -tap | grep mysql tcp6 0 0 [::]:mysql [::]:* LISTEN 7510/mysqld --> Installation successful 2. Set up MySQL remote access 1. Edit the mysql configuration file and comment out bind-address = 127.0.0.1 vi /etc/mysql/mysql.conf.d/mysqld.cnf 2. Use root to enter the mysql command line and execute the following two commands. In the example, the root account password of mysql is: root grant all on *.* to root@'%' identified by 'root' with grant option; flush privileges; 3. Restart mysql /etc/init.d/mysql restart 3. Various methods to modify MySQL root password Method 1: Use the SET PASSWORD command mysql -u root mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass'); Method 2: Using mysqladmin mysqladmin -u root password "newpass" If the root password has been set, use the following method mysqladmin -u root password oldpass "newpass" Method 3: Use UPDATE to edit the user table directly mysql -u root mysql> use mysql; mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root'; mysql> FLUSH PRIVILEGES; When you lose the root password, you can use mysqld_safe --skip-grant-tables & mysql -u root mysql mysql> UPDATE user SET password=PASSWORD("new password") WHERE user='root'; mysql> FLUSH PRIVILEGES; Summarize The above is the method of Mysql installation, configuration tuning and root password modification introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Detailed explanation of using Nginx reverse proxy to solve cross-domain problems
>>: How to implement a lucky wheel game in WeChat applet
Docker is being used in more and more scenarios. ...
Table of contents 1. Front-end leading process: 2...
Some special characters and icons used in the pro...
Table of contents 1. prototype (explicit prototyp...
Description: Set a timer to replace the content of...
Download the official website Choose the version ...
This article shares with you the MySQL 8.0.13 ins...
1. Introduction The topic of whether to use forei...
Form submission code 1. Source code analysis <...
Network Communication Overview When developing an...
Table of contents Preface 1. Nginx+Tomcat 2. Conf...
How to implement the "Set as homepage" ...
Table of contents Passing parameters between pare...
I made a Dockerfile for openresty on centos7 and ...
*******************Introduction to HTML language (...