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
Table of contents 1. Development Environment 2. I...
Table of contents Preface Optional Chaining Nulli...
1. Video tag Supports automatic playback in Firef...
Table of contents 1. Preparation 2. Decompression...
1. Install libfastcommon-1.0.43. The installation...
Since its release in 2013, Docker has been widely...
Don't be surprised if you see some kind of und...
Table of contents Preface: 1. Create a project wi...
In a web page, the <input type="file"...
Tab selection cards are used very frequently on r...
Table of contents For example: General writing: S...
Enable remote access rights for mysql By default,...
1. Write a split script (splitNginxLog.sh) * Beca...
MySQL and connection related timeouts Preface: To...
Sometimes we may encounter such a requirement, th...