Mysql下载地址:http://www.mysql.com/downloads/mysql/
- [root@server3 ~]# tar zxf mysql-5.1.58.tar.gz
- [root@server3 ~]# cd mysql-5.1.58
- [root@server3 mysql-5.1.58]# ./configure --prefix=/usr/local/mysql5.1.58 \
- --localstatedir=/usr/local/mysql5.1.58/data \
- --without-debug \
- --without-ndb-debug \
- --with-collation=utf8_general_ci \
- --enable-thread-safe-client \
- --enable-assembler \
- --enable-profiling \
- --with-big-tables \
- --with-mysqld-ldflags=-all-static \
- --with-client-ldflags=-all-static \
- --with-charset=utf8 \
- --with-extra-charsets=all \
- --with-plugins=innobase,partition \
- --with-mysqld-user=mysql \
- --without-embedded-server \
- --with-unix-socket-path=/tmp/mysql.sock
- [root@server3 mysql-5.1.58]#make && make install
- [root@server3 mysql-5.1.58]#useradd mysql
- [root@server3 mysql-5.1.58]#mkdir /usr/local/mysql5.1.58/data
- [root@server3 mysql-5.1.58]# cp support-files/my-medium.cnf /usr/local/mysql5.1.58/my.cnf
- [root@server3 mysql-5.1.58]#chown -R root:mysql /usr/local/mysql5.1.58
- [root@server3 mysql-5.1.58]#chown -R mysql:mysql/usr/local/mysql5.1.58/data
- [root@server3 mysql-5.1.58]#/usr/local/mysql5.1.58/bin/mysql_install_db --basedir=/usr/local/mysql5.1.58 --user=mysql
- [root@server3 ~]# /usr/local/mysql5.1.58/bin/mysqld_safe --defaults-file=/usr/local/mysql5.1.58/my.cnf --user=mysql &
- export PATH=/usr/local/mysql5.1.58/bin:$PATH
- [root@server3 ~]#source /etc/profile
- [root@server3 ~]# mysql
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 1
- Server version: 5.1.58-log Source distribution
- Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
- This software comes with ABSOLUTELY NO WARRANTY. This is free software,
- and you are welcome to modify and redistribute it under the GPL v2 license
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- mysql> exit
- [root@server3 ~]# mysqladmin -u root password '123456'
- [root@server3 ~]# mysql -uroot -p
- Enter password: //这里输入root用户的密码
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 5
- Server version: 5.1.58-log Source distribution
- Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
- This software comes with ABSOLUTELY NO WARRANTY. This is free software,
- and you are welcome to modify and redistribute it under the GPL v2 license
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- mysql> show databases;
- +--------------------+
- | Database |
- +--------------------+
- | information_schema |
- | mysql |
- | test |
- +--------------------+
- 3 rows in set (0.00 sec)
- mysql>
- [root@server3 ~]#mysqladmin -uroot -p shutdown
- nter password: //输入mysql的root用户密码