In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Because ubuntu has been used before rarely use centos, today need to install the database, in order to quickly solve this need of the mentality, start to install mysql, but look at a lot of materials, and finally did not succeed, an hour is enough time, and finally humbly ask friends, finally see Starting MySQL. SUCCESS!
Don't talk too much nonsense, starting now. Also deepen their own impression. You can't apt-get all the time. Centos doesn't let you do this.
One: preparatory work
Configure firewall to open port 3306
[root@TTXS ~] # vi / etc/sysconfig/iptables
-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 22-j ACCEPT # is available by default.
-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 3306-j ACCEPT # I don't know why this is added after 22.
Restart the firewall for its configuration to take effect:
[root@TTXS ~] # / etc/init.d/iptables restart
Turn off SELINUX:
[root@TTXS ~] # vi / etc/selinux/config
Add the following information later:
SELINUX=disable
Save exit.
View the current version information:
[root@TTXS ~] # rpm-qa | grep mysql
If so, uninstall it.
Uninstall command: [root@TTXS ~] # yum-y remove (database name)
Second: install Cmake and compile tools for Mysql
Install all directly:
[root@TTXS src] # cd / usr/local/src/
[root@TTXS src] # yum install cmake ncurses5-devel gcc gathers + bison openssl openssl-devel ncurses ncurses-devel gcc-c++-y
Continue after installation:
Three: formal installation:
Download the mysql version
[root@TTXS src] # wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.27.tar.gz
[root@TTXS src] # tar zxvf mysql-5.5.27.tar.gz
[root@TTXS src] # cd / usr/local/mysql
Install ncurses-devel package and bison package, if any, you don't need to install them
[root@TTXS mysql] # yum install ncurses-devel
[root@TTXS mysql] # yum install bison
Configure user groups:
[root@TTXS mysql-5.5.27] # groupadd mysql # add mysql user group
[root@TTXS mysql-5.5.27] # useradd-g mysql mysql- s / bin/false # create mysql users and join the mysql group. Mysql users are not allowed to log in directly to the system
[root@TTXS mysql-5.5.27] # mkdir-p / data/mysql # create a database storage directory
[root@TTXS mysql-5.5.27] # chown-R mysql:mysql / data/mysql/ # set database directory permissions
[root@TTXS mysql-5.5.27] # mkdir-p / usr/local/mysql # set the installation directory
[root@TTXS mysql-5.5.27] # cmake. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DMYSQL_DATADIR=/data/mysql-DSYSCONFDIR=/etc
[root@TTXS mysql-5.5.27] # make & & make install
Waiting for installation
Four: configuration
[root@TTXS mysql-5.5.27] # cd / usr/local/mysql
[root@TTXS mysql] # cp. / support-files/my-huge.cnf / etc/my.cnf # copy the configuration file and overwrite it if it exists
[root@TTXS mysql] # vi / etc/my.cnf # Editor, add a line under [mysqld]
Datadir = / data/mysql
[root@TTXS mysql] #. / scripts/mysql_install_db-- user=mysql # generates mysql system database
[root@TTXS mysql] # cp. / support-files/mysql.server / etc/rc.d/init.d/mysqld # add mysql to the system startup
[root@TTXS mysql] # chmod 755 / etc/init.d/mysqld # increase execution permissions
[root@TTXS init.d] # chkconfig mysqld on # join boot boot
[root@TTXS init.d] # vi / etc/rc.d/init.d/mysqld # Editor
Basedir=/usr/local/mysql # mysql Program installation path
Datadir=/data/mysql # mysql data storage vi path
[root@TTXS mysql] # service mysql start # start
# success Tip: Starting MySQL. SUCCESS!
Add mysql services to the system environment variable
[root@TTXS mysql] # vi / etc/profile
Add: export PATH=$PATH:$JAVA_HOME/bin:/usr/local/mysql/bin
[root@TTXS mysql] # source / etc/profile # effective
Five: set the password
[root@TTXS mysql] #. / mysqladmin-u root password root # set successfully
[root@TTXS mysql] # service mysql restart # restart
[root@TTXS mysql] # mysql-u root-p root # enter mysql
Enter password: # enter password
The above is the centos6.5 installation mysql documentation.
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.