91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

CentOS下mysql 卸載,安裝,測試全過程

發布時間:2020-07-29 21:03:19 來源:網絡 閱讀:263 作者:高鵬舉 欄目:MySQL數據庫

Mysql卸載
yum remove mysql mysql-server mysql-libs compat-mysql51
rm -rf /var/lib/mysql
rm /etc/my.cnf
查看是否還有mysql軟件:
rpm -qa|grep mysql
有的話繼續刪除


Mysql安裝
1>若本地沒有安裝包 可以考慮使用yum命令進行下載
# yum -y install mysql-server
# yum -y install php-mysql
2>安裝后,MySQL自動啟動, 【linux教程】 ,默認沒有用戶名和密碼,設置新密碼
# /usr/bin/mysqladmin -u root password 'aaaaaa'
[root@luozhonghua ~]# /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 is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
解決:
2.1》/etc/rc.d/init.d/mysqld status 看看mysql是否已經啟動
3.2》service mysqld start
3>登錄MySQL
> mysql -u root -p
enter password:’aaaaaa’


4>賦權連接的主機
#grant select,insert,update,delete on *.* to root@192.168.1.101 identified by 'aaaaaa'
grant select,insert,update,delete on *.* to root@127.0.0.1 identified by 'aaaaaa';




5>更改默認字符集
# cp my-medium.cnf /etc/my.cnf
在[client]下加入 default-character-set=utf8
在[mysqld]下加入 default-character-set=utf8
查找安裝路徑
Rpm -qa | grep mysql
Rpm -ql 包名
[root@luozhonghua 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>設置mysql開機自啟動
# vi /etc/rc.local
加入如下一行
#/usr/share/mysql/mysql.server start
7>重新啟動MySQL
# /etc/init.d/mysql restart
service mysqld restart


8>測試;


[root@luozhonghua ~]# 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) 2000, 2013, 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> create database xxx
-> ;
Query OK, 1 row affected (0.06 sec)


mysql> ls
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual th at corresponds to your MySQL server version for the right syntax to use near 'ls' at 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 an error in your SQL syntax; check the manual th at corresponds to your MySQL server version for the right syntax to use near 'database' at 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(20) name null);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual th at corresponds to your MySQL server version for the right syntax to use near 'int id not null,
varchar(20) 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 an error in your SQL syntax; check the manual th at corresponds to your MySQL server version for the right syntax to use near ')' at 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 an error in your SQL syntax; check the manual th at corresponds to your MySQL server version for the right syntax to use near 'ls' at line 1
mysql> show tables;
Empty set (0.00 sec)


mysql>

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

绥中县| 延长县| 庆元县| 黔西| 大关县| 呈贡县| 盐亭县| 宁波市| 新源县| 资中县| 环江| 化州市| 绥中县| 平凉市| 上杭县| 宁乡县| 津南区| 大宁县| 长乐市| 新乡市| 慈溪市| 龙江县| 高碑店市| 绥化市| 苏尼特右旗| 梨树县| 乌兰察布市| 中江县| 望城县| 泰顺县| 通州区| 梁平县| 侯马市| 白玉县| 抚松县| 合水县| 泸溪县| 和政县| 新昌县| 宜城市| 安康市|