In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
In this issue, the editor will bring you an example analysis of installing MySQL-5.6.31 under linux using the yum-y install command. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
1 preparation before installation
System version: linux (version centos6.5 64-bit system) 64-bit operating system
Download MySQL MySQL-5.6.31-1.linux_glibc2.5.x86_64.rpm-bundle.tar
Mysql download official website: http://dev.mysql.com/downloads/file/?id=463181
2 after download, unzip it in your newly created folder: mine is under the mysql folder
[root@localhost mysql] # tar-ivh MySQL-5.6.31-1.linux_glibc2.5.x86_64.rpm-bundle.tar
3 start the installation
A check MySQL and related RPM packages for installation, if any
Remove (rpm-e name or yum-y remove name)
[root@localhost mysql] # rpm-qa | grep-I mysql # #-I is case-insensitive
MySQL-client-5.6.31-1.linux_glibc2.5.x86_64
MySQL-server-5.6.31-1.linux_glibc2.5.x86_64
[root@localhost mysql] # rpm-e MySQL-client-5.6.31-1.linux_glibc2.5.x86_64 # # both methods can be removed
[root@localhost mysql] # rpm-qa | grep-I mysql
MySQL-server-5.6.31-1.linux_glibc2.5.x86_64
[root@localhost mysql] # yum-y remove MySQL-server-5.6.31-1.linux_glibc2.5.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
-> Running transaction check
-> Package MySQL-server.x86_64 0RU 5.6.31-1.linux_glibc2.5 will be erased
-> Finished Dependency Resolution
.
Removed:
MySQL-server.x86_64 0RO 5.6.31-1.linux_glibc2.5
Complete!
Next, install the server and client: in yum-y install mode
1 check the details of the file first
[root@localhost mysql] # ls-l
The total dosage is 623100
-rw-r--r--. 1 7155 31415 23624679 May 18 22:13 MySQL-client-5.6.31-1.linux_glibc2.5.x86_64.rpm
-rw-r--r--. 1 7155 31415 4588279 May 18 22:14 MySQL-devel-5.6.31-1.linux_glibc2.5.x86_64.rpm
-rw-r--r--. 1 7155 31415 117877215 May 18 22:14 MySQL-embedded-5.6.31-1.linux_glibc2.5.x86_64.rpm
-rw-r--r--. 1 7155 31415 89759062 May 18 22:15 MySQL-server-5.6.31-1.linux_glibc2.5.x86_64.rpm
-rw-r--r--. 1 7155 31415 2424499 May 18 22:15 MySQL-shared-5.6.31-1.linux_glibc2.5.x86_64.rpm
-rw-r--r--. 1 7155 31415 5181 145 May 18 22:15 MySQL-shared-compat-5.6.31-1.linux_glibc2.5.x86_64.rpm
-rw-r--r--. 1 7155 31415 75560152 May 18 22:15 MySQL-test-5.6.31-1.linux_glibc2.5.x86_64.rpm
[root@localhost mysql] #
All we have to do is install two red places:
Install the server:
[root@localhost mysql] # yum-y install MySQL-server-5.6.31-1.linux_glibc2.5.x86_64.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
.
Installed:
MySQL-server.x86_64 0RO 5.6.31-1.linux_glibc2.5
Complete
Start the service after installation:
[root@localhost mysql] # / etc/init.d/mysql start
Starting MySQL. SUCCESS!
(ps: if you get an error when starting the service here: for example, if you uninstall mysql and reinstall mysql It is possible to report this error: Starting MySQL. ERROR! The server quit without updating PID file (/ var/lib/mysql/localhost.localdomain.pid). This is because the mysql localhost.localdomain.pid process you uninstalled is not clean. At this time, you can check your process number: ps-ef | grep-I mysqld, and then find the process to kill it as follows:
[root@localhost mysql] # ps-ef | grep-I mysqld
Root 3643 10 13:48 pts/0 00:00:00 / bin/sh / usr/bin/mysqld_safe-- datadir=/var/lib/mysql-- pid-file=/var/lib/mysql/localhost.localdomain.pid
Mysql 3756 3643 1 13:48 pts/0 00:00:38 / usr/sbin/mysqld-basedir=/usr-datadir=/var/lib/mysql-plugin-dir=/usr/lib64/mysql/plugin-user=mysql-log-error=/var/lib/mysql/localhost.localdomain.err-pid-file=/var/lib/mysql/localhost.localdomain.pid
Root 5023 10 14:48 pts/0 00:00:00 / bin/sh / usr/bin/mysqld_safe-- datadir=/var/lib/mysql-- pid-file=/var/lib/mysql/localhost.localdomain.pid
Mysql 5136 5023 6 14:48 pts/0 00:00:04 / usr/sbin/mysqld-basedir=/usr-datadir=/var/lib/mysql-plugin-dir=/usr/lib64/mysql/plugin-user=mysql-log-error=/var/lib/mysql/localhost.localdomain.err-pid-file=/var/lib/mysql/localhost.localdomain.pid
Root 5282 2384 0 14:49 pts/0 00:00:00 grep-I mysqld
[root@localhost mysql] # kill-9 3756 # # 5136 3756 kill 5136 if it doesn't work.
[root@localhost mysql] # / etc/init.d/mysql start
Starting MySQL. SUCCESS!
)
[root@localhost mysql] #
View the default password after yum installation:
[root@localhost mysql] # cat / root/.mysql_secret
# The random password set for the root user at Sun Jul 24 12:14:33 2016 (local time): PwEYW3GrS6Yn1kp2
Next, install the client
[root@localhost mysql] # yum-y install MySQL-client-5.6.31-1.linux_glibc2.5.x86_64.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
..
Installed:
MySQL-client.x86_64 0RO 5.6.31-1.linux_glibc2.5
Complete!
[root@localhost mysql] # rpm-qa | grep-I mysql
MySQL-client-5.6.31-1.linux_glibc2.5.x86_64
MySQL-server-5.6.31-1.linux_glibc2.5.x86_64
[root@localhost mysql] #
At this point, you can see that the server client has been installed, and now begin to log in.
Note before you log in here. If you have previously installed mysql and modified your random password: PwEYW3GrS6Yn1kp2 (everyone's random password is different) and then reinstall it, you will still be cat / root/.mysql_secret at this time, but at this time, we will log in to mysql:
Mysql-uroot-hlocalhost-p
[root@localhost] # mysql-uroot-hlocalhost-p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@localhost ~] #
This error will occur, that is, I can't log in, because at this time, the password is not this, but the password you modified before. I don't know the reason yet. Anyway, I re-logged in with the password I used before uninstalling, and the login was successful:
[root@localhost] # mysql-uroot-hlocalhost-p
Enter password:
Welcome to the MySQL monitor. Commands end with; or\ g.
Your MySQL connection id is 5
Server version: 5.6.31 MySQL Community Server (GPL)
..
Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.
Mysql >
It may be that some places have not been completely uninstalled, resulting in the recording of previous user information. Check this later.
If you haven't installed mysql in this system before, then after you log in, enter a random password and you will log in successfully and view the database successfully.
Mysql > show databases; ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
Mysql > set password=password ('123456'); Query OK, 0 rows affected (0.00 sec) mysql > show databases; +-+ | Database | +-+ | information_schema | | mysql | | performance_schema | | test | +-+
4 rows in set (0.00 sec)
Mysql > use mysql
Database changed
Mysql >
The above is the example that Xiaobian shared for you to install MySQL-5.6.31 under linux using the yum-y install command. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.