Lab Environment:
Operating system: CentOS 6.8
Virtual machines: VMware
Database: mysql-5.1.62.tar.gz
Installation steps:
#wget http://soft.vpser.net/datebase/mysql/mysql-5.1.62.tar.gz
#tar ZXF mysql-5.1.62.tar.gz
[email protected] mysql-5.1.62]#./configure \
--prefix=/usr/local/mysql \
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \
--localstatedir=/usr/local/mysql/data \
--enable-assembler \
--enable-thread-safe-client \
--with-mysqld-user=mysql \
--with-big-tables \
--without-debug \
--with-pthread \
--enable-assembler \
--with-extra-charsets=complex \
--with-readline \
--WITH-SSL \
--with-embedded-server \
--enable-local-infile \
--with-plugins=partition,innobase \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static
/bin/rm:cannot remove ' Libtoolt ': No such file or directory
config.status:executing default Commands
Thank for choosing mysql!
Remember to check the platform specific part of the reference manual
For hints about installing MySQL on your platform.
Also has a look at the files in the Docs directory.
[Email protected] mysql-5.1.62]# #make
[email protected] mysql-5.1.62]# #make Install
[Email protected] mysql-5.1.62]# ls-l support-files/*.cnf
[Email protected] mysql-5.1.62]#/BIN/CP support-files/my-small.cnf/etc/my.cnf
[Email protected] mysql-5.1.62]# CAT/ETC/MY.CNF
[Email protected] mysql-5.1.62]# mkdir-p/usr/local/mysql/data
[Email protected] mysql-5.1.62]# chown-r mysql/usr/local/mysql
[Email protected] mysql-5.1.62]#/usr/local/mysql/bin/mysql_install_db--user=mysql
[Email protected] mysql-5.1.62]# chmod-r 777/tmp/
#启动mysql数据库
[email protected] mysql-5.1.62]# CP Support-files/mysql.server/usr/local/mysql/bin
[Email protected] mysql-5.1.62]# chmod 700/usr/local/mysql/bin/mysql.server
[Email protected] mysql-5.1.62]#/usr/local/mysql/bin/mysql.server start #启动数据库的方法之一
Starting MySQL. success!
[Email protected] mysql-5.1.62]# Netstat-lnt|grep 3306
[[email protected] mysql-5.1.62]#/usr/local/mysql/bin/mysql.server stop
Shutting down MySQL ... success!
#配置全局路径
[Email protected] mysql-5.1.62]# echo ' Export path= $PATH:/usr/local/mysql/bin ' >>/etc/profile
#source/etc/profile
#配置/etc/init.d/mysqld Start method of starting the database two
[email protected] mysql-5.1.62]# CP support-files/mysql.server/etc/init.d/mysqld
[Email protected] mysql-5.1.62]# chmod 700/etc/init.d/mysqld
[Email protected] mysql-5.1.62]#/etc/init.d/mysqld restart
Shutting down MySQL ... success!
Starting MySQL. success!
[Email protected] mysql-5.1.62]#/etc/init.d/mysqld restart
Shutting down MySQL ..... success!
Starting MySQL. success!
You can log in using the following three commands:
Mysql-uroot-p,mysql-uroot,mysql-uroot-p ' Password '
After the MySQL installation is complete, by default, the Administrator account root is no password.
To add a password for root:
[Email protected] mysql-5.1.62]# mysqladmin-u root password ' skyboy '
[[email protected] mysql-5.1.62]# MySQL
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)
Mysql> select User,host from Mysql.user;
+------+-----------------+
| user | Host |
+------+-----------------+
| Root | 127.0.0.1 |
| | localhost |
| Root | localhost |
| | www.sky9890.com |
| Root | www.sky9890.com |
+------+-----------------+
#下面删除多余账号:
mysql> drop user ' @localhost;
Query OK, 0 rows Affected (0.00 sec)
mysql> drop user ' @www. sky9890.com;
mysql> drop user ' root ' @www. sky9890.com;
Query OK, 0 rows Affected (0.00 sec)
This article is from the "sky9890" blog, make sure to keep this source http://sky9896.blog.51cto.com/2330653/1884152
MySQL single-instance installation configuration Guide