In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "CentOS6.6 installs the binary package mysql5.6". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "CentOS6.6 installation binary package mysql5.6" it!
CentOS6.6 installs the binary package mysql5.6
First, install MySQL
1. Download the installation package mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz
2. Delete the my.cnf file in the etc directory
[root@localhost~] # rm / etc/my.cnf
Execute the following command to create the mysql user group
[root@localhost~] # groupadd mysql
4. Execute the following command to create a user with the username mysql and join the mysql user group
[root@localhost ~] # useradd-g mysql mysql
5. Put the downloaded binary package into the / usr/local/ directory.
[root@localhost ~] # mv mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz / usr/local/
6. Extract the installation package
[root@localhost ~] # cd / usr/local
[root@localhost localtar] # tar-zxvf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz / usr/local/
7. Rename the extracted folder to mysql
[root@localhost local] # mv mysql-5.6.35-linux-glibc2.5-x86_64 mysql
8. Create a new configuration file my.cnf under etc, and add the following code to the file:
[mysql]
# set mysql client default character set
Default-character-set=utf8
Socket=/tmp/mysql.sock
[mysqld]
Skip-name-resolve
# set port 3306
Port = 3306
# set the installation directory of mysql
Basedir=/usr/local/mysql
# set the storage directory of the data in the mysql database
Datadir=/usr/local/mysql/data
# maximum number of connections allowed
Max_connections=200
# the character set used by the server defaults to the 8-bit coded latin1 character set
Character-set-server=utf8
# default storage engine to be used when creating new tables
Default-storage-engine=INNODB
Lower_case_table_names=1
Max_allowed_packet=16M
9. Enter the directory where mysql software is installed
[root@localhost local] # cd mysql
[root@localhost mysql] # chown-R mysql:mysql. / modify the current directory owner to be a mysql user
[root@localhost mysql] #. / scripts/mysql_install_db-- user=mysql installation database
[root@localhost mysql] # chown-R mysql:mysql data modifies the current data directory owner to be a mysql user
This database has been installed!
2. Configure MySQL
1. The maximum permission granted to my.cnf.
[root@localhost mysql] # chown 777 / etc/my.cnf
2. Set the boot self-startup service control script
(1) copy the startup script to the resource directory
[root@localhost mysql] # cp. / support-files/mysql.server / etc/rc.d/init.d/mysqld
(2) increase mysqld service control script execution permissions
[root@localhost mysql] # chmod + x / etc/rc.d/init.d/mysqld
(3) add mysqld service to system service
[root@localhost mysql] # chkconfig-- add mysqld
(4) check whether the mysqld service is in effect.
[root@localhost mysql] # chkconfig-- list mysqld
The command output is similar to the following:
Mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
It indicates that the mysqld service has come into effect and starts automatically with system startup at run levels 2, 3, 4 and 5. Later, you can use the service command to control the start and stop of mysql.
3. Start msql
[root@localhost mysql] # service mysqld start
4. Add the bin directory of mysql to the PATH environment variable and edit the / etc/profile file
[root@localhost mysql] # vi / etc/profile
Add the following information at the end of the file:
Export PATH=$PATH:/usr/local/mysql/bin
Execute the following command to make the changes take effect:
[root@localhost mysql] #. / etc/profile
5. Log in to mysql with a root account. There is no password by default.
[root@localhost mysql] # mysql
6. Set the root account password
Mysql > use mysql
Mysql > update user set password=password ('123456') where user='root' and host='localhost'
Mysql > flush privileges
Mysql > exit
7. Log in again with your password
[root@localhost mysql] # mysql-u root-p
Enter password:
8. Set up remote host login
Mysql > GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' IDENTIFIED BY' 123456 'WITH GRANT OPTION
Here 123456 is the password, if the password is another value, you can change it. Nothing else needs to be changed.
At this point, I believe you have a deeper understanding of "CentOS6.6 install binary package mysql5.6". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.