|
Alternatively you can run:
/usr/local/mysql5//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/mysql5/ ; /usr/local/mysql5//bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysql5//mysql-test ; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/
7. 启动数据库
[root@ycdatadbsupport local]# mysqld_safe --defaults-file=/etc/my.cnf &
[1] 7666
[root@ycdatadbsupport local]# 140612 14:46:33 mysqld_safe Logging to '/data/mysql/mysql_3306/data/error.log'.
140612 14:46:33 mysqld_safe Starting mysqld daemon with databases from /data/mysql/mysql_3306/data
8. 连接MSYQL, 修改ROOT密码。第一次登录是不需要密码的。 这样MYSQL就安装成功了。
[root@ycdatadbsupport local]# mysql -uroot -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.5.37-log MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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.
(testing)root@ycdatadbsupport [(none)]> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "vipshop";
Query OK, 0 rows affected (0.00 sec)
(testing)root@ycdatadbsupport [(none)]> use mysql;
Database changed
(testing)root@ycdatadbsupport [mysql]> update user set password = password('vipshop') where user='root';
Query OK, 4 rows affected (0.01 sec)
Rows matched: 5 Changed: 4 Warnings: 0
(testing)root@ycdatadbsupport [mysql]> commit;
Query OK, 0 rows affected (0.00 sec)
(testing)root@ycdatadbsupport [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
(testing)root@ycdatadbsupport [mysql]> exit
Bye
[root@ycdatadbsupport local]# mysql -uroot -p -S /tmp/mysql.sock
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.37-log MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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.
(testing)root@ycdatadbsupport [(none)]>
?
|