初始化数据字典,启动MySQL
[root@dbtest ~]# cd /data/mysql/
[root@dbtest mysql]# /service/mysql/scripts/mysql_install_db --defaults-file=/service/mysql/my.cnf --basedir=/service/mysql --datadir=/data/mysql --user=mysql
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:
/service/mysql/bin/mysqladmin -u root password 'new-password'
/service/mysql/bin/mysqladmin -u root -h 192.168.1.52 password 'new-password'
Alternatively you can run:
/service/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 /service/mysql ; /service/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /service/mysql/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /service/mysql/scripts/mysqlbug script!
[root@dbtest mysql]# ll
total 1064
-rw-rw---- 1 mysql mysql 27293 Dec 15 08:03 binlog-master.000001
-rw-rw---- 1 mysql mysql 1037542 Dec 15 08:03 binlog-master.000002
-rw-rw---- 1 mysql mysql 46 Dec 15 08:03 binlog-master.index
drwx------ 2 mysql root 4096 Dec 15 08:03 mysql
drwx------ 2 mysql mysql 4096 Dec 15 08:03 performance_schema
drwx------ 2 mysql root 4096 Dec 15 08:03 test
[root@dbtest mysql]# /service/mysql/bin/mysqld_safe --defaults-file=/service/mysql/my.cnf --basedir=/service/mysql --datadir=/data/mysql --user=mysql &
[1] 3315
[root@dbtest mysql]# 121215 08:03:41 mysqld_safe Logging to '/data/mysql/dbtest.err'.
121215 08:03:41 mysqld_safe Starting mysqld daemon with databases from /data/mysql
[root@dbtest mysql]# /service/mysql/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.27-log Master_DB
Copyright (c) 2000, 2011, 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>
