login as: root
Access denied
root@192.168.0.53's password:
Last login: Thu Mar 21 10:32:25 2013
[root@aa-mysql-02 ~]#
[root@aa-mysql-02 ~]#
[root@aa-mysql-02 ~]#
[root@aa-mysql-02 ~]#
[root@aa-mysql-02 ~]# ls /media/
[root@aa-mysql-02 ~]# mount /dev/cdrom /media/
mount: you must specify the filesystem type
[root@aa-mysql-02 ~]# mount /dev/cdrom /media/
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@aa-mysql-02 ~]# rpm -qa|grep mysql
mysql-libs-5.1.61-4.el6.x86_64
[root@aa-mysql-02 ~]# yum install mysql mysql-server
Loaded plugins: fastestmirror, security
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 56 - "Failure when receiving data from the peer"
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[root@aa-mysql-02 ~]# ls
anaconda-ks.cfg install.log install.log.syslog
[root@aa-mysql-02 ~]# cd /etc/yum.repos.d/
[root@aa-mysql-02 yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
[root@aa-mysql-02 yum.repos.d]# mv CentOS-Base.repo CentOS-Base
[root@aa-mysql-02 yum.repos.d]# vi CentOS-Media.repo
[root@aa-mysql-02 yum.repos.d]# yum install mysql mysql-server
Loaded plugins: fastestmirror, security
Determining fastest mirrors
* c6-media:
c6-media | 4.0 kB 00:00 ...
c6-media/primary_db | 4.5 MB 00:00 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql.x86_64 0:5.1.61-4.el6 will be installed
---> Package mysql-server.x86_64 0:5.1.61-4.el6 will be installed
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.61-4.el6.x86_64
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed
--> Finished Dependency Resolution
Access denied
root@192.168.0.53's password:
Last login: Thu Mar 21 10:32:25 2013
[root@aa-mysql-02 ~]#
[root@aa-mysql-02 ~]#
[root@aa-mysql-02 ~]#
[root@aa-mysql-02 ~]#
[root@aa-mysql-02 ~]# ls /media/
[root@aa-mysql-02 ~]# mount /dev/cdrom /media/
mount: you must specify the filesystem type
[root@aa-mysql-02 ~]# mount /dev/cdrom /media/
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@aa-mysql-02 ~]# rpm -qa|grep mysql
mysql-libs-5.1.61-4.el6.x86_64
[root@aa-mysql-02 ~]# yum install mysql mysql-server
Loaded plugins: fastestmirror, security
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 56 - "Failure when receiving data from the peer"
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[root@aa-mysql-02 ~]# ls
anaconda-ks.cfg install.log install.log.syslog
[root@aa-mysql-02 ~]# cd /etc/yum.repos.d/
[root@aa-mysql-02 yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
[root@aa-mysql-02 yum.repos.d]# mv CentOS-Base.repo CentOS-Base
[root@aa-mysql-02 yum.repos.d]# vi CentOS-Media.repo
[root@aa-mysql-02 yum.repos.d]# yum install mysql mysql-server
Loaded plugins: fastestmirror, security
Determining fastest mirrors
* c6-media:
c6-media | 4.0 kB 00:00 ...
c6-media/primary_db | 4.5 MB 00:00 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql.x86_64 0:5.1.61-4.el6 will be installed
---> Package mysql-server.x86_64 0:5.1.61-4.el6 will be installed
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.61-4.el6.x86_64
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql x86_64 5.1.61-4.el6 c6-media 882 k
mysql-server x86_64 5.1.61-4.el6 c6-media 8.6 M
Installing for dependencies:
perl-DBD-MySQL x86_64 4.013-3.el6 c6-media 134 k
Package Arch Version Repository Size
================================================================================
Installing:
mysql x86_64 5.1.61-4.el6 c6-media 882 k
mysql-server x86_64 5.1.61-4.el6 c6-media 8.6 M
Installing for dependencies:
perl-DBD-MySQL x86_64 4.013-3.el6 c6-media 134 k
Transaction Summary
================================================================================
Install 3 Package(s)
================================================================================
Install 3 Package(s)
Total download size: 9.6 M
Installed size: 27 M
Is this ok [y/N]: y
Downloading Packages:
--------------------------------------------------------------------------------
Total 4.2 MB/s | 9.6 MB 00:02
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mysql-5.1.61-4.el6.x86_64 1/3
Installing : perl-DBD-MySQL-4.013-3.el6.x86_64 2/3
Installing : mysql-server-5.1.61-4.el6.x86_64 3/3
Verifying : perl-DBD-MySQL-4.013-3.el6.x86_64 1/3
Verifying : mysql-server-5.1.61-4.el6.x86_64 2/3
Verifying : mysql-5.1.61-4.el6.x86_64 3/3
Installed size: 27 M
Is this ok [y/N]: y
Downloading Packages:
--------------------------------------------------------------------------------
Total 4.2 MB/s | 9.6 MB 00:02
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mysql-5.1.61-4.el6.x86_64 1/3
Installing : perl-DBD-MySQL-4.013-3.el6.x86_64 2/3
Installing : mysql-server-5.1.61-4.el6.x86_64 3/3
Verifying : perl-DBD-MySQL-4.013-3.el6.x86_64 1/3
Verifying : mysql-server-5.1.61-4.el6.x86_64 2/3
Verifying : mysql-5.1.61-4.el6.x86_64 3/3
Installed:
mysql.x86_64 0:5.1.61-4.el6 mysql-server.x86_64 0:5.1.61-4.el6
mysql.x86_64 0:5.1.61-4.el6 mysql-server.x86_64 0:5.1.61-4.el6
Dependency Installed:
perl-DBD-MySQL.x86_64 0:4.013-3.el6
perl-DBD-MySQL.x86_64 0:4.013-3.el6
Complete!
[root@aa-mysql-02 yum.repos.d]# service mysqld status
mysqld is stopped
[root@aa-mysql-02 yum.repos.d]# service mysqld start
Initializing MySQL database: Installing MySQL system tables...
OK
Filling help tables...
OK
[root@aa-mysql-02 yum.repos.d]# service mysqld status
mysqld is stopped
[root@aa-mysql-02 yum.repos.d]# service mysqld start
Initializing MySQL database: 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
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:
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h aa-mysql-02.puppet.com password 'new-password'
/usr/bin/mysqladmin -u root -h aa-mysql-02.puppet.com password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
/usr/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.
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 ; /usr/bin/mysqld_safe &
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[ OK ]
Starting mysqld: [ OK ]
[root@aa-mysql-02 yum.repos.d]#
Starting mysqld: [ OK ]
[root@aa-mysql-02 yum.repos.d]#
[root@aa-mysql-02 yum.repos.d]# service mysqld status
mysqld (pid 26045) is running...
[root@aa-mysql-02 yum.repos.d]# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@aa-mysql-02 yum.repos.d]# service mysqld stop
Stopping mysqld: [ OK ]
[root@aa-mysql-02 yum.repos.d]# mysqld_safe --user=mysql --skip-grant-tables &
[1] 26136
[root@aa-mysql-02 yum.repos.d]# 130321 13:07:38 mysqld_safe Logging to '/var/log/mysqld.log'.
130321 13:07:38 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
mysqld (pid 26045) is running...
[root@aa-mysql-02 yum.repos.d]# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@aa-mysql-02 yum.repos.d]# service mysqld stop
Stopping mysqld: [ OK ]
[root@aa-mysql-02 yum.repos.d]# mysqld_safe --user=mysql --skip-grant-tables &
[1] 26136
[root@aa-mysql-02 yum.repos.d]# 130321 13:07:38 mysqld_safe Logging to '/var/log/mysqld.log'.
130321 13:07:38 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
[root@aa-mysql-02 yum.repos.d]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.61 Source distribution
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.61 Source distribution
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.
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> use msyql
ERROR 1049 (42000): Unknown database 'msyql'
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
ERROR 1049 (42000): Unknown database 'msyql'
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update user set password=password('pepper') where user='root' host='localhost';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'host='localhost'' at line 1
mysql> update user set password=password('pepper') where user='root'and host='localhost';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> update user set password=password('pepper') where user='root' host='localhost';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'host='localhost'' at line 1
mysql> update user set password=password('pepper') where user='root'and host='localhost';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[root@aa-mysql-02 yum.repos.d]# service mysqld restart
130321 13:10:08 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
[1]+ Done mysqld_safe --user=mysql --skip-grant-tables
[root@aa-mysql-02 yum.repos.d]# service mysqld status
mysqld (pid 26378) is running...
[root@aa-mysql-02 yum.repos.d]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.61 Source distribution
Bye
[root@aa-mysql-02 yum.repos.d]# service mysqld restart
130321 13:10:08 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
[1]+ Done mysqld_safe --user=mysql --skip-grant-tables
[root@aa-mysql-02 yum.repos.d]# service mysqld status
mysqld (pid 26378) is running...
[root@aa-mysql-02 yum.repos.d]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.61 Source distribution
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.
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> exit
Bye
[root@aa-mysql-02 yum.repos.d]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@aa-mysql-02 yum.repos.d]#
Bye
[root@aa-mysql-02 yum.repos.d]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@aa-mysql-02 yum.repos.d]#
转载于:https://blog.51cto.com/285118/1159524