中科院超级计算青岛分中心mysql安装手册

软件名称: 
mysql
安装目录: 
用户目录下面
使用用户: 

gemzhang

安装步骤: 

Mysql5.1.72版本安装过程:

1、解压 tar -zxvf mysql-5.1.72.tar.gz

并进入安装包目录:cd mysql-5.1.72/

2、编译:

/configure --prefix=/public/home/gemzhang/wjp/mysql5172 --sysconfdir=/public/home/gemzhang/wjp/mysql5172/etc --libexecdir=/public/home/gemzhang/wjp/mysql5172/sbin --enable-thread-safe-client --enable-assembler --enable-local-infile --with-unix-socket-path=/public/home/gemzhang/wjp/mysql5172/var/mysql.sock --without-debug --localstatedir=/public/home/gemzhang/wjp/mysql5172/srv/mysql --with-mysqld-user=wjp --with-extra-charsets=all --datadir=/public/home/gemzhang/wjp/mysql5172/data1 --with-tcp-port=8641

编译最后出现如下字样便是编译成功:

Thank you for choosing MySQL!

 

Remember to check the platform specific part of the reference manual

for hints about installing MySQL on your platform.

Also have a look at the files in the Docs directory.

 

3、make

4、make install

 

5、创建etc目录及my.cnf文件:

进入安装目录: cd mysql5172

在安装目录下创建etc目录:mkdir etc

 

拷贝my.cnf:

cp data1/mysql/my-medium.cnf etc/my.cnf

 

6、修改my.cnf,增加如下标红四行:vi etc/my.cnf

# The following options will be passed to all MySQL clients

[client]

#password       = your_password

port           = 8641

socket                = /public/home/gemzhang/wjp/mysql5172/var/mysql.sock

 

# Here follows entries for some specific programs

 

# The MySQL server

[mysqld]

port           = 8641

socket                = /public/home/gemzhang/wjp/mysql5172/var/mysql.sock

skip-external-locking

skip-name-resolve

key_buffer_size = 16M

max_allowed_packet = 1M

table_open_cache = 64

sort_buffer_size = 512K

net_buffer_length = 8K

read_buffer_size = 256K

read_rnd_buffer_size = 512K

myisam_sort_buffer_size = 8M

datadir =/public/home/gemzhang/wjp/mysql5172/data1/

pid-file =/public/home/gemzhang/wjp/mysql5172/var/mysql.pid

 

7、创建数据库表

 在安装目录下面执行:./bin/mysql_install_db --user=wjp --defaults-file=/public/home/ gemzhang/wjp /mysql5172/etc/my.cnf

Installing MySQL system tables...

OK

Filling help tables...

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:

 

/public/home/ gemzhang/wjp/mysql5172l/bin/mysqladmin -u root password 'new-password'

/public/home/ gemzhang/wjp/mysql5172/bin/mysqladmin -u root -h 192.168.0.83 password 'new-password'

 

Alternatively you can run:

/public/home/ gemzhang/wjp/mysql5172/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 /public/home/ gemzhang/wjp/mysql5172 ; /public/home/gemzhang/wjp/mysql5172/bin/mysqld_safe &

 

You can test the MySQL daemon with mysql-test-run.pl

cd /public/home/ gemzhang/wjp/mysql5172/mysql-test ; perl mysql-test-run.pl

 

Please report any problems with the /public/home/ gemzhang/wjp/mysql5172/bin/mysqlbug script!

 

8、启动服务

gemzhang@node83:~/wjp/mysql5172>./bin/mysqld_safe --user=wjp &