CentOS under MySQL Uninstall, install, test the whole process

Source: Internet
Author: User

MySQL Uninstall
Yum remove MySQL mysql-server mysql-libs compat-mysql51
Rm-rf/var/lib/mysql
Rm/etc/my.cnf
See if you have MySQL software:
Rpm-qa|grep MySQL
Some words continue to delete


MySQL Installation
1> If you do not have a local installation package, consider using the yum command to download
# yum-y Install Mysql-server
# yum-y Install Php-mysql
2> after installation, MySQL automatically start, "Linux tutorial", default no user name and password, set a new password
#/usr/bin/mysqladmin-u root password ' aaaaaa '
[Email protected] ~]#/usr/bin/mysqladmin-u root password ' aaaaaa '
/usr/bin/mysqladmin:connect to server at ' localhost ' failed
Error: ' Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2) '
Check that Mysqld was running and that the socket: '/var/lib/mysql/mysql.sock ' exists!
Solve:
2.1 "/ETC/RC.D/INIT.D/MYSQLD status to see if MySQL has been started
3.2 "Service mysqld start
3> log in to MySQL
> Mysql-u root-p
Enter password: ' aaaaaa '


4> Empowering connected Hosts
#grant select,insert,update,delete On * * to [email protected] identified by ' aaaaaa '
Grant Select,insert,update,delete on * * to [email protected] identified by ' aaaaaa ';




5> changing the default character set
# CP MY-MEDIUM.CNF/ETC/MY.CNF
Add Default-character-set=utf8 under [client]
Add Default-character-set=utf8 under [mysqld]
Find the installation path
Rpm-qa | grep MySQL
RPM-QL Package Name
[Email protected] charsets]# Find/usr-name my-medium.cnf
/usr/share/doc/mysql-server-5.1.73/my-medium.cnf
/usr/share/mysql/my-medium.cnf


#6 > Set up mysql boot from boot
# vi/etc/rc.local
Add the following line
#/usr/share/mysql/mysql.server start
7> restarting MySQL
#/etc/init.d/mysql Restart
Service mysqld Restart


8> test;


[Email protected] ~]# mysql-u root-p
Enter Password:
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 3
Server version:5.1.73 Source Distribution


Copyright (c) and/or, Oracle, its affiliates. All rights reserved.


Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.


Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.


mysql> CREATE DATABASE xxx
;
Query OK, 1 row affected (0.06 sec)


Mysql> ls
;
Error 1064 (42000): You have a error in your SQL syntax; Check the manual th at corresponds-your MySQL server version for the right syntax-use-near ' ls ' on line 1
Mysql> Show databases
;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| MySQL |
| Test |
| xxx |
+--------------------+
4 rows in Set (0.06 sec)


mysql> use XXX;
Database changed
Mysql> Show Database
;
Error 1064 (42000): You have a error in your SQL syntax; Check the manual th at corresponds-your MySQL server version for the right syntax-use-near ' database ' on line 1
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| MySQL |
| Test |
| xxx |
+--------------------+
4 rows in Set (0.01 sec)


mysql> use XXX;
Database changed
Mysql> CREATE TABLE Test (
-int ID NOT NULL,
varchar (+) name null);
Error 1064 (42000): You have a error in your SQL syntax; Check the manual th at corresponds-your MySQL server version for the right syntax-to-use "int id not NULL,
varchar () name null) ' at line 2
Mysql> Show tables;
Empty Set (0.00 sec)


Mysql> CREATE TABLE Dbtest (
ID int,
, name varchar);
Error 1064 (42000): You have a error in your SQL syntax; Check the manual th at corresponds-your MySQL server version for the right syntax-use-near ') ' on line 3
Mysql> CREATE TABLE Dbtest (
ID int,
-Name varchar (10));
Query OK, 0 rows affected (0.07 sec)


Mysql> Show tables;
+---------------+
| tables_in_xxx |
+---------------+
| dbtest |
+---------------+
1 row in Set (0.01 sec)


mysql> drop table xxx;
ERROR 1051 (42S02): Unknown table ' xxx '
mysql> drop table dbtest;
Query OK, 0 rows Affected (0.00 sec)


Mysql> ls
;
Error 1064 (42000): You have a error in your SQL syntax; Check the manual th at corresponds-your MySQL server version for the right syntax-use-near ' ls ' on line 1
Mysql> Show tables;
Empty Set (0.00 sec)


Mysql>

This article is from the "high-tech blog" blog, please be sure to keep this source http://gaopengju.blog.51cto.com/12830710/1946271

CentOS under MySQL Uninstall, install, test the whole process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.