欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

linux mysql5.6版本的安装配置过程

程序员文章站 2024-02-22 20:52:34
从今年3月份开始mysql官网开始发布相关的5.6系列的各个版本,对于mysql5.6系列的版本对一起的版本进行了全局性的细节性加强;个人感觉,以下是在虚拟机中配置的mys...
从今年3月份开始mysql官网开始发布相关的5.6系列的各个版本,对于mysql5.6系列的版本对一起的版本进行了全局性的细节性加强;个人感觉,以下是在虚拟机中配置的mysql5.6.10源码安装的过程分享记录下:

[root@mysql5 ~]# groupadd mysql
[root@mysql5 ~]# useradd -r -g mysql mysql
[root@mysql5 ~]# ls
anaconda-ks.cfg install.log install.log.syslog mysql-5.6.10.tar.gz
[root@mysql5 ~]# cd /usr/local/
[root@mysql5 local]# ls
bin etc games include lib libexec sbin share src
[root@mysql5 local]# cp /root/mysql-5.6.10.tar.gz /usr/local/
[root@mysql5 local]# ll
total 34468
drwxr-xr-x 2 root root 4096 jan 27 2010 bin
drwxr-xr-x 2 root root 4096 jan 27 2010 etc
drwxr-xr-x 2 root root 4096 jan 27 2010 games
drwxr-xr-x 2 root root 4096 jan 27 2010 include
drwxr-xr-x 2 root root 4096 jan 27 2010 lib
drwxr-xr-x 2 root root 4096 jan 27 2010 libexec
-rw-r--r-- 1 root root 35174149 apr 17 00:55 mysql-5.6.10.tar.gz
drwxr-xr-x 2 root root 4096 jan 27 2010 sbin
drwxr-xr-x 4 root root 4096 apr 17 00:32 share
drwxr-xr-x 2 root root 4096 jan 27 2010 src
[root@mysql5 local]# tar -zxvf mysql-5.6.10.tar.gz
[root@mysql5 local]# cd mysql-5.6.10
cmake .
make && make install

[root@mysql5 mysql-5.6.10]# chown -r mysql.mysql /usr/local/mysql
[root@mysql5 mysql-5.6.10]#
[root@mysql5 mysql-5.6.10]# cd /usr/local/mysql/scripts/
[root@mysql5 scripts]# ./mysql_install_db --user=mysql --basedir=/usr/local/mys
ql --datadir=/usr/local/mysql/data
installing mysql system tables...2013-04-17 01:26:58 0 [warning] timestamp with implicit default value is deprecated. please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-04-17 01:26:58 18715 [note] innodb: the innodb memory heap is disabled
2013-04-17 01:26:58 18715 [note] innodb: mutexes and rw_locks use innodb's own implementation
2013-04-17 01:26:58 18715 [note] innodb: compressed tables use zlib 1.2.3
2013-04-17 01:26:58 18715 [note] innodb: cpu does not support crc32 instructions
2013-04-17 01:26:58 18715 [note] innodb: initializing buffer pool, size = 128.0m
2013-04-17 01:26:58 18715 [note] innodb: completed initialization of buffer pool
2013-04-17 01:26:58 18715 [note] innodb: the first specified data file ./ibdata1 did not exist: a new database to be created!
2013-04-17 01:26:59 18715 [note] innodb: setting file ./ibdata1 size to 12 mb
2013-04-17 01:26:59 18715 [note] innodb: database physically writes the file full: wait...
2013-04-17 01:26:59 18715 [note] innodb: setting log file ./ib_logfile101 size to 48 mb
2013-04-17 01:26:59 18715 [note] innodb: setting log file ./ib_logfile1 size to 48 mb
2013-04-17 01:26:59 18715 [note] innodb: renaming log file ./ib_logfile101 to ./ib_logfile0
2013-04-17 01:26:59 18715 [warning] innodb: new log files created, lsn=45781
2013-04-17 01:26:59 18715 [note] innodb: doublewrite buffer not found: creating new
2013-04-17 01:26:59 18715 [note] innodb: doublewrite buffer created
2013-04-17 01:26:59 18715 [note] innodb: 128 rollback segment(s) are active.
2013-04-17 01:26:59 18715 [warning] innodb: creating foreign key constraint system tables.
2013-04-17 01:26:59 18715 [note] innodb: foreign key constraint system tables created
2013-04-17 01:26:59 18715 [note] innodb: creating tablespace and datafile system tables.
2013-04-17 01:26:59 18715 [note] innodb: tablespace and datafile system tables created.
2013-04-17 01:26:59 18715 [note] innodb: waiting for purge to start
2013-04-17 01:26:59 18715 [note] innodb: 1.2.10 started; log sequence number 0
2013-04-17 01:26:59 18715 [note] binlog end
2013-04-17 01:26:59 18715 [note] innodb: fts optimize thread exiting.
2013-04-17 01:26:59 18715 [note] innodb: starting shutdown...
2013-04-17 01:27:00 18715 [note] innodb: shutdown completed; log sequence number 1625977
ok

filling help tables...2013-04-17 01:27:00 0 [warning] timestamp with implicit default value is deprecated. please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-04-17 01:27:00 18738 [note] innodb: the innodb memory heap is disabled
2013-04-17 01:27:00 18738 [note] innodb: mutexes and rw_locks use innodb's own implementation
2013-04-17 01:27:00 18738 [note] innodb: compressed tables use zlib 1.2.3
2013-04-17 01:27:00 18738 [note] innodb: cpu does not support crc32 instructions
2013-04-17 01:27:00 18738 [note] innodb: initializing buffer pool, size = 128.0m
2013-04-17 01:27:00 18738 [note] innodb: completed initialization of buffer pool
2013-04-17 01:27:00 18738 [note] innodb: highest supported file format is barracuda.
2013-04-17 01:27:00 18738 [note] innodb: 128 rollback segment(s) are active.
2013-04-17 01:27:00 18738 [note] innodb: waiting for purge to start
2013-04-17 01:27:01 18738 [note] innodb: 1.2.10 started; log sequence number 1625977
2013-04-17 01:27:01 18738 [note] binlog end
2013-04-17 01:27:01 18738 [note] innodb: fts optimize thread exiting.
2013-04-17 01:27:01 18738 [note] innodb: starting shutdown...
2013-04-17 01:27:02 18738 [note] innodb: shutdown completed; log sequence number 1625987
ok

to start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

please remember to set a password for the mysql root user !
to do so, start the server, then issue the following commands:

/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h mysql5.6 password 'new-password'

alternatively you can run:

/usr/local/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. this is
strongly recommended for production servers.

see the manual for more instructions.

you can start the mysql daemon with:

cd . ; /usr/local/mysql/bin/mysqld_safe &

you can test the mysql daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

please report any problems with the ./bin/mysqlbug script!

the latest information about mysql is available on the web at

http://www.mysql.com

support mysql by buying support/licenses at http://shop.mysql.com

new default config file was created as /usr/local/mysql/my.cnf and
will be used by default by the server when you start it.
you may edit this file to change server settings

warning: default config file /etc/my.cnf exists on the system
this file will be read by default by the mysql server
if you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

[root@mysql5 scripts]#
[root@mysql5 scripts]# cd /usr/local/mysql/support-files/
[root@mysql5 support-files]# cp mysql.server /etc/rc.d/init.d/mysql
[root@mysql5 support-files]# cp my-default.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf'? y
[root@mysql5 support-files]#
[root@mysql5 support-files]# chkconfig -add mysql
-add: unknown option
[root@mysql5 support-files]# chkconfig --add mysql
[root@mysql5 support-files]# chkconfig mysql on
[root@mysql5 support-files]# service mysql start
starting mysql. [ ok ]
[root@mysql5 support-files]#
[root@mysql5 data]# mysql -u mysql -p -s /tmp/mysql.sock
enter password:
welcome to the mysql monitor. commands end with ; or \g.
your mysql connection id is 1
server version: 5.6.10 source distribution

type 'help;' or '\h' for help. type '\c' to clear the buffer.

mysql>
mysql> status;
--------------
mysql ver 14.12 distrib 5.0.77, for redhat-linux-gnu (i686) using readline 5.1

connection id: 1
current database:
current user: mysql@localhost
ssl: not in use
current pager: stdout
using outfile: ''
using delimiter: ;
server version: 5.6.10 source distribution
protocol version: 10
connection: localhost via unix socket
server characterset: latin1
db characterset: latin1
client characterset: latin1
conn. characterset: latin1
unix socket: /tmp/mysql.sock
uptime: 3 min 38 sec

threads: 1 questions: 5 slow queries: 0 opens: 67 flush tables: 1 open tables: 60 queries per second avg: 0.022
--------------

mysql>