|
亦CentOS芸蒂mysql臬血歇摰鋆: yum list installed | grep mysql
$ G, L1 i$ z4 l) M交芸蒂摰鋆mysql嚗憒雿貉蝸CentOS蝟餌芸蒂mysql鞈摨恬 mysql-libs.x86_64 5.1.73-5.el6_6 @anaconda-CentOS-201508042137.x86_64/6.7 yum -y remove mysql-libs.x86_64嚗交憭靘鞈湔隞嗅靘甈∪貉
4 \8 _7 r( f( ~5 ~7 H# G% W亦yum摨思mysql砌縑: yum list | grep mysql yum -y list mysql* * U( f) \, D, A& Y2 T' j+ I g! s6 j
雿輻肘um摰鋆mysql鞈摨: yum -y install mysql-server mysql mysql-devel 瘜剁摰鋆mysql芣臬鋆鈭鞈摨嚗芣摰鋆mysql-server貊嗡摰鋆鈭serverclient + t! h+ @0 |0 t: D) e. c" Z
憒頛詨 mysql 箇 error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 銵函內芸 mysqld 隞亥撓 service mysqld start,敺擐砌箇曆誑銝閮,雿銝鈭函閮: - To start mysqld at boot time you have to copy
- 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:
- /usr/bin/mysqladmin -u root password 'new-password'
- /usr/bin/mysqladmin -u root -h video.yocoolnet.com password 'new-password'
- Alternatively you can run:
- /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.
- See the manual for more instructions.
- You can start the MySQL daemon with:
- 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
銴鋆賭誨蝣亦摰鋆mysql唳桀砌縑: rpm -qi mysql-server % x+ f p% j! O% I
閮剖 /etc/my.cnf4 T$ A# j( [6 q4 O9 q3 T
[mysqld]
$ H1 H% c& B+ W4 Edatadir=/var/lib/mysql1 u" O* j0 Y* K
socket=/var/lib/mysql/mysql.sock
# a& n/ n" @' n$ C# Default to using old password format for compatibility with mysql 3.x2 @9 w6 R* S- }1 l5 r% P% h8 j
# clients (those using the mysqlclient10 compatibility package).+ b9 F0 w! W1 D& a" I9 F
old_passwords=1
8 c5 ]: w: i. s( @default-character-set = utf8
# n: i3 v w* |6 ~+ I
8 K% L1 g9 u% @) _( f% [) O1 ?[mysql.server]' ?; _* k7 J* v" Z( W
user=mysql
$ Q3 t5 D2 G2 J6 ~: s( W" Wbasedir=/var/lib; c* N1 {1 c9 w4 S* H
/ c3 A+ I* ^* C' s* s; i( |[mysqld_safe], C7 E3 o! Y1 E1 M, A% @2 l* t
log-error=/var/log/mysqld.log
& C+ b: |- V' k ` L$ y) Zpid-file=/var/run/mysqld/mysqld.pid
' U* a# @6 L0 x" \2 N' T1 Z* P* b7 q- Z2 K& `- p" s* M$ Q
[mysql]
1 p0 l: u0 ?4 p$ k1 W* X3 _default-character-set = utf8
: W. ` F4 ~3 e7 E4 M# X" X6 @ 閮剖 MySQL 函頂蝯曹韏瑕
2 `% _% m6 v7 s8 H# chkconfig mysqld on8 I2 Z) I3 m% C- J
4 r- |" q( p7 D
蝣箄 MySQL 芸3 a5 b1 Y' q- c% Y
# chkconfig --list mysqld% W/ o9 u$ Q. K. J. m+ v
憒2--5榣n撠屠K
# @( w) w5 E U X0 ^" R' n. k! \ mysqld 0: off 1: off 2: on 3: on 4: on 5: on 6: off
) T# ^+ z0 s' P: k* {6 G" f' ]$ v MySQL m# n3 G0 b9 q' M' ]$ R/ w3 ?
# service mysqld start /usr/bin/mysqld_safe & 蝣箄 MySQL 臬血歇 #service mysqld status mysqld (pid 33778) is running... cd /usr/mysql-test ; perl mysql-test-run.pl ) k( Z, w: T" n. [3 t
MySQL 隞亙嚗敹閮剖 root 撖蝣; {0 f. z) s$ P' Q% s/ Z
# mysqladmin -u root password 'Your Password' 瑁隞 # /usr/bin/mysql_secure_installation 閰 root 臬血舀餃 mysql: mysql -u root -p Enter password: (頛詨叵oot 撖蝣) 蝝 MySQL database單 # mysql_upgrade -u root -p 頛詨亙蝣
+ f s+ T2 l! E9 |
[啣鋆mysql] http://tecadmin.net/remove-mysql-completely-from-linux-system/ 閮: 隞句um摰鋆每entOS 5.11/i386 箇暸航炊,see /var/log/mysqld.log : 160414 10:07:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 160414 10:07:57 [Note] /usr/libexec/mysqld (mysqld 5.5.49) starting as process 9426 ... 160414 10:07:57 [Note] Plugin 'FEDERATED' is disabled. /usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist 160414 10:07:57 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 160414 10:07:57 InnoDB: The InnoDB memory heap is disabled 160414 10:07:57 InnoDB: Mutexes and rw_locks use InnoDB's own implementation 160414 10:07:57 InnoDB: Compressed tables use zlib 1.2.3 160414 10:07:57 InnoDB: Using Linux native AIO 160414 10:07:57 InnoDB: Initializing buffer pool, size = 128.0M 160414 10:07:57 InnoDB: Completed initialization of buffer pool 160414 10:07:57 InnoDB: highest supported file format is Barracuda. 160414 10:07:57 InnoDB: Waiting for the background threads to start 160414 10:07:58 InnoDB: 5.5.49 started; log sequence number 1595675 160414 10:07:58 InnoDB: !!! innodb_force_recovery is set to 1 !!! 160414 10:07:58 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306 160414 10:07:58 [Note] - '0.0.0.0' resolves to '0.0.0.0'; 160414 10:07:58 [Note] Server socket created on IP: '0.0.0.0'. 160414 10:07:58 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist :mysqld⊥芸撱箇 /var/lib/mysql/鞈摨,甇日撱箇DB
8 E& t) x" N8 u8 `& r+ emysql_install_db --user=mysql --ldata=/var/lib/mysql/ ===>check /var/lib/mysql/批歇撱箇閮勗DB; g+ m$ c- u' R0 _$ y; I
+ c ]0 Z( w' n; p4 {. w& Z( ~
蝝啁: https://www.cadch.com/modules/news/article.php?storyid=227 |