mysql安装一rpm包安装(四)

2015-01-25 19:30:39 · 作者: · 浏览: 23
tement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

[root@host2 mysql_rpm]#

8
已经有了mysql用户和组
[root@host2 mysql_rpm]# id mysql
uid=495(mysql) gid=492(mysql) groups=492(mysql)

[root@host2 mysql_rpm]# nl /etc/group | grep mysql
60 mysql:x:492:
[root@host2 mysql_rpm]# cat /etc/group | grep mysql
mysql:x:492:
[root@host2 mysql_rpm]# cat /etc/shadow | grep mysql
mysql:!!:16455::::::
[root@host2 mysql_rpm]#

9

RPM安装方式文件分布

?

Table 2.6 MySQLInstallation Layout for Linux RPM Packages from the MySQL DeveloperZone

Directory

Contentsof Directory

/usr/bin

Clientprograms and scripts

/usr/sbin

Themysqldserver

/var/lib/mysql

Logfiles, databases

/usr/share/info

Manualin Info format

/usr/share/man

Unixmanual pages

/usr/include/mysql

Include(header) files

/usr/lib/mysql

Libraries

/usr/share/mysql

Miscellaneoussupport files, including error messages, character set files,sample configuration files, SQL for database installation

/usr/share/sql-bench

Benchmarks




10
copy配置文件
# 没有这一步也可以按内置参数
[root@host2 mysql_rpm]# cp /usr/share/mysql/my-default.cnf /etc/my.cnf
[root@host2 mysql_rpm]#

11
start
[root@host2 mysql_rpm]# service mysql status
MySQL is not running [FAILED]
[root@host2 mysql_rpm]# service mysql start
Starting MySQL.. [ OK ]

11
查验
[root@host2 mysql_rpm]# netstat -anpl | grep mysql
tcp 0 0 :::3306 :::* LISTEN 5924/mysqld
unix 2 [ ACC ] STREAM LISTENING 76015 5924/mysqld /var/lib/mysql/mysql.sock
[root@host2 mysql_rpm]#

12
安装客户端
[root@host2 mysql_rpm]# rpm -ivh MySQL-client-5.6.22-1.linux_glibc2.5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
[root@host2 mysql_rpm]#

13
连到mysql并修改
[root@host2 mysql_rpm]# nl /root/.mysql_secret
1 # The random password set for the root user at Tue Jan 20 13:10:43 2015 (local time): F76Wy1A4G9ZuLcaG

[root@host2 mysql_rpm]# mysql -p mysql
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.22

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.

mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql>
mysql> SET PASSWORD = PASSWORD('123456');
Query OK, 0 rows affected (0.31 sec)

mysql> flush privileges;
mysql> \q
Bye
[root@host2 mysql_rpm]#


附:
这样安装后的文件
[root@host2 mys