当前位置:网站首页>How to quickly install MySQL 5.7.17 under CentOS 6.5
How to quickly install MySQL 5.7.17 under CentOS 6.5
2022-06-29 04:23:00 【Yisu cloud】
CentOS 6.5 How to quickly install MySQL 5.7.17
This article introduces in detail “CentOS 6.5 How to quickly install MySQL 5.7.17”, Detailed content , The steps are clear , The details are handled properly , Hope this article “CentOS 6.5 How to quickly install MySQL 5.7.17” The article can help you solve your doubts , Let's follow Xiaobian's ideas and go deeper slowly , Let's learn new knowledge together .

1. Download installation package
from MySQL Download the latest mysql Installation package mysql-5.7.17-Linux-glibc2.5-x86_64.tar.gz
Be careful , Be sure to download .tar.gz, Don't download that .tar My bag
Upload the installation package to /opt Under the table of contents :
2. Check if the library file exists , Delete... If it exists
[[email protected] ~]# rpm -qa | grep mysqlmysql-libs-5.1.73-3.el6_5.x86_64 [[email protected] ~]# rpm -e mysql-libs-5.1.73-3.el6_5.x86_64 --nodeps/sbin/ldconfig: File /usr/lib64/libpq.so.5.8 is empty, not checked. [[email protected] ~]# rpm -qa | grep mysql
3.Mysql Depend on libaio library
yum search libaio # search for infoyum install libaio # install library
4. Perform the following steps to install Mysql
groupadd mysql useradd -r -g mysql -s /bin/false mysqlcd /usr/localtar -zxvf /opt/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz -C /opt/ ln -s /opt/mysql-5.7.17-linux-glibc2.5-x86_64 mysqlcd mysql mkdir mysql-files chmod 750 mysql-files chown -R mysql . chgrp -R mysql . bin/mysqld --initialize --user=mysql
If an error is reported in this step, it is as follows :
[ERROR] –initialize specified but the data directory has files in it. Aborting.
Solution :
rm -rf /var/lib/mysql/
Re execute the above command , Prompt generated a temporary password :
2017-01-03T09:12:33.748807Z 1 [Note] A temporary password is generated for [email protected]: =*-gFoje>1Pr
Performing this step should generate a data Catalog , If not generated , That must be because there are already installed in the system mysql, Follow the steps first 2 Unload , Then execute again
bin/mysqld --initialize --user=mysql bin/mysql_ssl_rsa_setup chown -R root . chown -R mysql data mysql-files bin/mysqld_safe --user=mysql &
The following step is optional
cp support-files/mysql.server /etc/init.d/mysqld
5. Configuration after installation
modify /usr/local/mysql/support-files/my-default.cnf
basedir = /usr/local/mysql datadir = /usr/local/mysql/data port = 3306
Make a copy to /etc/ Under the table of contents , Rename it to my.cnf
cp my-default.cnf /etc/my.cnf
add to mysql environment variable
vim /etc/profileexport MYSQL_HOME=/usr/local/mysqlexport PATH=$MYSQL_HOME/bin:$PATHsource /etc/profile
6. start-up mysql
service mysqld start
Successful launch :
[[email protected] support-files]# service mysqld startStarting MySQL.Logging to '/usr/local/mysql/data/ambari.err'. . [ OK ] [[email protected] support-files]# service mysqld statusMySQL running (8010) [ OK ]
This step may lead to unsuccessful startup , The error message is as follows :
MySQL: Starting MySQL….. ERROR! The server quit without updating PID file
7. modify root password :
use
mysql -uroot -p
When logging in , Enter previously recorded root password , The prompt password is incorrect , Can't , We have to revise it ourselves root It's a password
The specific steps are as follows :
step1:
vim /etc/my.cnf
stay [mysqld] Next add a line skip-grant-tables
step2:
service mysqld restart after , You can directly use mysql Get into
mysql> update mysql.user set authentication_string=password('root') where user='root' and Host = 'localhost';
mysql> flush privileges;
mysql> quit;step3:
take /etc/my.cnf File restore , Restart mysql:service mysqld restart, It can be used at this time mysql -u root -p’root’ Into the
step4:
Enter into sql After that, you can change the password once through the following command , Otherwise, no other operation can be carried out :
mysql> SET PASSWORD = PASSWORD('mysql');step5:
stay sql Console execution show databases; give the result as follows :
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec)
Read here , This article “CentOS 6.5 How to quickly install MySQL 5.7.17” The article has been introduced , If you want to master the knowledge points of this article, you need to practice and use it yourself to understand , If you want to know more about this article , Welcome to the Yisu cloud industry information channel .
边栏推荐
猜你喜欢

If you choose the right school, you can enter Huawei as a junior college. I wish I had known

c语言 --- 分支结构

How sqlserver queries and removes results with null fields in the whole column

Error accessing database

赚钱的5个层次,你在哪一层?

Multi machine LAN office artifact rustdesk use push!!!

JSX的基本使用

女程序员晒出5月的工资条:工资是高,但是真累,网友评论炸锅了

LabVIEW显示Unicode字符

SEAttention 通道注意力機制
随机推荐
1017 A除以B分
干货丨微服务架构是什么?有哪些优点和不足?
Redis 缓存穿透、缓存击穿、缓存雪崩
How to merge upstream and downstream SQL data records
Untitled
c语言 --- 分支结构
Why are you a test / development programmer? Can you recall
Cisco voice card handling configuration
Call snapstateon closed sou from Oracle CDC
String不同创建方式的区别
Is the increased life insurance off the shelf? What additional life insurance products are available now?
SQL database stored procedure writing method
SqlServer如何查询除去整列字段为null的结果
Ansible best practices playbook different context rights raising demo
不使用union实现Mysql 列转行
Here comes Wi Fi 7. How strong is it?
[C language] explain the thread recycling function pthread_ join
My creation anniversary
The virtual machine MySQL cannot be connected to the local computer
[C language] address of stack memory associated with local variable 'num' returned