Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux installation MySQL database for test environment

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

1. First determine the version of your system and choose the appropriate mysql version

Cat / proc/version

2. Mysql download link address

Https://dev.mysql.com/downloads/mysql/

3. Upload, file rz

4. Extract the file

Tar-zxvf mysql-5.6.36-linux-glibc2.5-i686.tar.gz

5. Copy the decompressed file

Cp mysql-5.6.36-linux-glibc2.5-i686 / usr/local/mysql-r

Details: when you didn't install mysql before, now cp is equivalent to moving the directory mysql-5.6.36-linux-glibc2.5-i686.

And rename it to: mysql. You don't need to create a mysql directory first.

If you create mysql first, it will appear: / usr/local/mysql/mysql-5.6.36-linux-glibc2.5-i686, and then there will be problems with the installation.

6. Create user groups, create users, modify newly created passwords

Groupadd mysql

Useradd-r-g mysql mysql

Passwd mysql-then enter the password twice

7. Change to the directory mysql for file authorization and database installation

Cd / usr/local/mysql/

Chown-R-v mysql:mysql. /-- modify the owner of all files in the current directory to: mysql

. / scripts/mysql_install_db-- user=mysql

Chown-R root:root. / modify the owner of all files in the current directory as: mysql

Chown-R mysql:mysql data modifies the owner of all files under the current directory data to: mysql

8. Add boot up and put the startup script in the boot initialization directory

Welcome to join the test communication group (1017539290). You can discuss the topics you are interested in online with Daniel at any time, so that you can learn the most in the least time.

Cp support-files/mysql.server / etc/init.d/mysql

9. Start the mysql service

Service mysql start

Several commands about the mysql service

Service mysql start: Starting MYSQL. [OK]

Service mysql status: MySQL running (4095) [OK]

Service mysql stop: Shutting down MySQL.. [OK]

Service mysql restart: Shutting down MySQL.. [confirm] Starting MySQL. [OK]

10. Change to the mysql directory to change the password of root

Cd / usr/local/mysql

. / bin/mysqladmin-u root password 'root'

11. Put the mysql client in the default path

Ln-s / usr/local/mysql/bin/mysql / usr/local/bin/mysql

twelve。 Log into the database

Mysql-u root-p-enter the root password to log in

Show databases

Use mysql

Select host,user from user where user='root'

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report