1. Install mysql Run the following command to update the YUM source.
Run the following command to install MySQL.
Run the following command to view the MySQL version number.
The returned result is as follows, indicating that MySQL is installed successfully.
2. Configure MySQL Run the following command to start the MySQL service
Run the following command to set the MySQL service to start automatically at boot.
Account information (usually the default is root, 123456. If you forget the password, you can skip it and directly log in to the database as root and then change the password) //Steps//First find the mysql configuration file my.cnf, usually in /etc/my.cnf //cd into /etc and edit it directly with vim my.cnf (it seems that the username and password are at the top of the file) // Add skip-grant-tables under the [mysqld] tag // Press esc to exit editing: press wq to save and exit // Then restart the server service mysqld restart to make the changes take effect // mysql -u root to directly enter the database // Then change the password mysql> USE mysql; //mysql> UPDATE user SET Password = password ('new password') WHERE //User = 'root'; //mysql> flush privileges; //mysql> quit // After changing the password, change the configuration file back and delete the added sentence, then restart the server again // Then you can use mysql -u root -p to enter your new password to enter 3. Remote access to MySQL database I am using Navicat to connect to the MySQL database configured remotely in Alibaba Cloud After running the following command, enter the root user's password to log in to MySQL.
If an error like the one below appears, don’t panic. The error code is 1130, ERROR 1130: Host XXXX is not allowed to connect to this MySQL server. This may be due to a problem with the user permissions for remote connections. The solution is to log in to MySQL on the server and change the "host" field value in the "user" table in the "mysql" database from "localhost" to "%". mysql -u root -p mysql;use mysql; mysql;select 'host' from user where user='root'; mysql;update user set host = '%' where user = 'root'; mysql;flush privileges; mysql;select 'host' from user where user='root'; The first sentence is to log in as the privileged user root. The second sentence is to select the MySQL database. The third sentence is to view the host value of the user table in the MySQL database (that is, the host IP name for connection access). This concludes this article on how to manually deploy a remote MySQL database in Linux. For more information on manually deploying a remote MySQL database, please search 123WORDPRESS.COM's previous articles or continue browsing the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Front-end development must learn to understand HTML tags every day (1)
>>: Detailed explanation of the murder caused by a / slash in Nginx proxy_pass
This article shares the specific code of jquery t...
Table of contents Preface 1. Basic knowledge of d...
Table of contents Preface Introduction-Official E...
The specific code is as follows: <a href="...
Table of contents JavaScript prototype chain Obje...
In our life, work and study, social networks have ...
Table of contents LAMP architecture 1.Lamp Introd...
Table of contents The basic concept of modularity...
NProgress is the progress bar that appears at the...
Table of contents Preface 1. Project Architecture...
Table of contents 1. Initialize the array 2. Arra...
Preface This article introduces a tutorial on how...
background Temporary tablespaces are used to mana...
This article example shares the specific code of ...
Table of contents 1. Concurrent access control 2....