Alibaba Cloud ECS server builds Mysql database

1. Server system:

Alibaba Cloud Linux 3.2104 LTS 64-bit

2. Server folder creation

[Description]: Since the server is a new application, the server is a blank server.

1. Create a software folder
[Description]: used to store Mysql and other software


• First enter the root directory

• create opt folder

• Create softwar folder

2. Create the data folder

• First enter the home directory

• Create data folder

Mysql database construction

a. Upload the downloaded mysql compressed package to the server

b. Decompress the mysql compressed package

c. Move and rename

d. Create mysql user groups and users

e. Modify permissions

f. Create a data directory

g. Grant permissions

h. Configure my.cnf

i. Initialize the database

Enter the bin directory of mysql


j. View password [mysql initialization password]:

3.start Mysql

a. First place mysql.server in /etc/init.d/mysql

b. Start:

c. View mysql process

d. So far Mysql installation is successful

3. Change password

a. First log in to mysql using a randomly generated password

b. Login:

c. Change the password:

Linux sets mysql to allow remote connections

1. Log in to mysql, command: mysql -u root -p, and then enter the password.

2. Use the mysql library:

4. Query information:

[Description]: In the host field, localhost means that only the local machine is allowed to access. To realize remote connection, you can change the host of the root user to %, and % means to allow any host to access. If you need to set only specific ip access, you should change it to For the corresponding ip.

4. Modify the host field of the root user, command

5. To make this modification take effect immediately, order

6. Finally, connect remotely in Navicat under windows

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00

phone Contact Us