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

How to use yum to install MySQL in Linux system

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article introduces the relevant knowledge of "how to use yum to install MySQL in Linux system". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Environment: Centos 6.5

Linux uses the yum command to install mysql

\ 1. First check if the system is equipped with mysql

[root@localhost ~] # yum list installed mysql* [root@localhost ~] # rpm-qa | grep mysql*\ 2. Check to see if there is a package installed

[root@localhost] # yum list mysql*\ 3. Install the mysql client

[root@localhost] yum install mysql\ 4. Install the mysql server

[root@localhost] # yum install mysql-server [root@localhost ~] # yum install mysql-devel\ 5. Add the default character set to the / etc/my.cnf file

[root@localhost ~] # vim / etc/my.cnf

\ 6. Start or shut down the mysql service

[root@localhost ~] # service mysqld start-start mysql or / etc/init.d/mysqld start (turn off mysql # service mysql stop)\ 6. Set the boot to start the mysql service

[root@localhost] # chkconfig-- add mysqld

\ 7. Create a root user password of 123456

Mysqladmin-u root password 123456

[root@localhost] # mysqladmin-u root password 123456\ 8. Connect mysql

[root@localhost ~] # mysql-u root-p-enter password 123456

\ 9. Set remote access permissions

Mysql > use mysql mysql > GRANT ALL PRIVILEGES ON *. * TO 'admin'@'%'IDENTIFIED BY' admin' WITH GRANT OPTION;-the first admin is the user name, the second admin is the password,% indicates that all computers can be linked to mysql > flush privileges;-the setting takes effect immediately

Mysql > SELECT DISTINCT CONCAT ('User:''',user,'''@''',host,''';') AS query FROM mysql.user; mysql > exit -- exit mysql service [root@localhost ~] # vi / etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql default-character-set=utf8 # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # device address bind-address=0.0.0.0 # set device address [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld .pid [root@localhost ~] # service mysqld start-- restart the mysql service [root@localhost ~] # mysql-u root-p-- connect to mysql and enter the password mysql > show global variables like 'port' -- View port number +-+-+ | Variable_name | Value | +-+-+ | port | 3306 | +-+-+ 1 row in set (0.00 sec) 10. Connect to mysql using navcat

This is the end of "how to install MySQL using yum in Linux system". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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

Development

Wechat

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

12
Report