This version of MySQL Cluster is no longer maintained.
Please use the separate sources provided forMySQL Cluster instead.
See http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster.html
formoredetails.
Thank you forchoosing MySQL!
Remember to check the platform specific part of the reference manual
forhints about installing MySQL on your platform.
Also have a lookat the files inthe Docs directory.
[root@node6 mysql-5.1.73]# /usr/local/mysql/bin/mysql_install_db --basedir=/usr/local/mysql/ --datadir=/data/mysql/ --user=mysql
Installing MySQL system tables...
140104 16:18:43 [Warning] '--default-character-set'is deprecated and will be removed ina future release. Please use '--character-set-server'instead.
140104 16:18:43 [Warning] '--skip-locking'is deprecated and will be removed ina future release. Please use '--skip-external-locking'instead.
OK
Filling help tables...
140104 16:18:43 [Warning] '--default-character-set'is deprecated and will be removed ina future release. Please use '--character-set-server'instead.
140104 16:18:43 [Warning] '--skip-locking'is deprecated and will be removed ina future release. Please use '--skip-external-locking'instead.
OK
To start mysqld at boot timeyou have to copy
support-files/mysql.server to the right place foryour system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To doso, start the server, thenissue the following commands:
/usr/local/mysql//bin/mysqladmin-u root password 'new-password'
/usr/local/mysql//bin/mysqladmin-u root -h node6.test.com password 'new-password'
Alternatively you can run:
/usr/local/mysql//bin/mysql_secure_installation
whichwill also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended forproduction servers.
See the manual formoreinstructions.
You can start the MySQL daemon with:
cd/usr/local/mysql/; /usr/local/mysql//bin/mysqld_safe&
You can testthe MySQL daemon with mysql-test-run.pl
cd/usr/local/mysql//mysql-test; perl mysql-test-run.pl
Please report any problems with the /usr/local/mysql//scripts/mysqlbugscript!
注,从上面的内容中我们看到了几个警告,我们查看一下。
140104 16:18:43 [Warning] '--default-character-set'is deprecated and will be removed ina future release. Please use '--character-set-server'instead.
140104 16:18:43 [Warning] '--skip-locking'is deprecated and will be removed ina future release. Please use '--skip-external-locking'instead.
OK
Filling help tables...
140104 16:18:43 [Warning] '--default-character-set'is deprecated and will be removed ina future release. Please use '--character-set-server'instead.
140104 16:18:43 [Warning] '--skip-locking'is deprecated and will be removed ina future release. Please use '--skip-external-locking'instead.
从上面的警告可以看到,--default-character-set、--skip-locking选项已经过时,建议使用--character-set-server、--skip-external-locking。
7.查看一下初始化目录
[root@node6 data]# ls /data/mysql/
mysql mysql-bin.000001 mysql-bin.000002 mysql-bin.index test
8.启动一下mysql
[root@node6 ~]# service mysqld start
Starting MySQL.. SUCCESS!
9.测试访问一下
[root@node6 ~]# /usr/local/mysql/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection idis 1
Server version: 5.1.73-log Source distribution
Copyright (c) 2000, 2013, Oracle and/orits affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/orits
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;'or '\h'forhelp. Type '\c'to clearthe current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test|
+--------------------+
3 rows inset(0.00 sec)
mysql>
[root@node6 mysql]# vim /etc/profile.d/mysql.sh
exportPATH=$PATH:/usr/local/mysql/bin/
[root@node6 mysql]# source /etc/profile
[root@node6 mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection idis 2
Server version: 5.1.73-log Source distribution
Copyright (c) 2000, 2013, Oracle and/orits affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/orits
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;'or '\h'forhelp. Type '\c'to clearthe current input statement.
mysql>
[root@node6 mysql-5.5.35]# service mysqld restart
Shutting down MySQL. SUCCESS!
Starting MySQL.. SUCCESS!
13.执行更新程序并重启mysql
[root@node6 mysql-5.5.35]# /usr/local/mysql/bin/mysql_upgrade
Looking for 'mysql' as: /usr/local/mysql/bin/mysql
Looking for 'mysqlcheck' as: /usr/local/mysql/bin/mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysqld.sock'
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysqld.sock'
mydb.t1 OK
mydb.t2 OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Running 'mysql_fix_privilege_tables'...
OK
14.查看生成的更新文件
[root@node6 ~]# cd /data/mysql/
[root@node6 mysql]# ls
ibdata1 mysql mysql-bin.000004 mysql-bin.000008 node6.test.com.err
ib_logfile0 mysql-bin.000001 mysql-bin.000005 mysql-bin.000009 node6.test.com.pid
ib_logfile1 mysql-bin.000002 mysql-bin.000006 mysql-bin.index performance_schema
mydb mysql-bin.000003 mysql-bin.000007 mysql_upgrade_info test
[root@node6 mysql]# cat mysql_upgrade_info
5.5.35
15.尝试登录一下并查看一下版本
[root@node6 mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.5.35-log Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> select version();
+------------+
| version() |
+------------+
| 5.5.35-log |
+------------+
1 row in set (0.00 sec)
16.查看一下库和表
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mydb |
| mysql |
| performance_schema |
| test |
+--------------------+
5 rows in set (0.00 sec)
mysql> use mydb;
Database changed
mysql> show tables;
+----------------+
| Tables_in_mydb |
+----------------+
| t1 |
| t2 |
+----------------+
2 rows in set (0.00 sec)
mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
| 20971520 |
+----------+
1 row in set (0.00 sec)