|
亦CentOS芸蒂mysql臬血歇摰鋆: yum list installed | grep mysql * k& C$ J4 l! M8 H
交芸蒂摰鋆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嚗交憭靘鞈湔隞嗅靘甈∪貉 ' v% @! f3 I$ P8 j" o7 Q" X
亦yum摨思mysql砌縑: yum list | grep mysql yum -y list mysql* 0 ?( k r. G! i% e% d4 \+ N
雿輻肘um摰鋆mysql鞈摨: yum -y install mysql-server mysql mysql-devel 瘜剁摰鋆mysql芣臬鋆鈭鞈摨嚗芣摰鋆mysql-server貊嗡摰鋆鈭serverclient % K7 L: y( H$ B9 d, M _- B: b
憒頛詨 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
% ~, T9 L3 P# J2 P6 W( i$ n閮剖 /etc/my.cnf
+ R: a2 \; [4 i) ?8 D2 d [mysqld]
9 r7 |( h4 h; X8 S5 B( k6 Rdatadir=/var/lib/mysql
6 l |4 V& U0 ]: ?: {socket=/var/lib/mysql/mysql.sock
3 R5 u5 l5 ?* ~, E1 Q p: H# Default to using old password format for compatibility with mysql 3.x
1 R' E5 D0 \7 z# clients (those using the mysqlclient10 compatibility package).
+ i5 G+ `1 i8 H. _7 I7 P+ ]% P3 R. Qold_passwords=1
* K/ X. A: a) }" |" s/ Rdefault-character-set = utf8! E. B( P) b# {9 @3 J6 j
# N! s8 O8 `5 W, H# j. M; w* d[mysql.server]
) b# r- @3 f$ s1 L7 A* l; Cuser=mysql
. l* u) q% R) S; R! {- ~basedir=/var/lib) h/ P) `8 ?' C1 R! I
2 k- S0 f% u. S" H
[mysqld_safe]+ o: j, p8 E, C e) @
log-error=/var/log/mysqld.log- W O4 r% r1 I" c/ [
pid-file=/var/run/mysqld/mysqld.pid
6 A; Y2 C0 {& ]9 ~; d! a G: s4 K* H1 n9 O
[mysql]
& X% e! k" C/ n1 Q+ e$ Qdefault-character-set = utf81 i3 E! H- g( |' R9 t+ M% Y
閮剖 MySQL 函頂蝯曹韏瑕" B' J/ L. K- x f( B* C
# chkconfig mysqld on) }' l, Q) x- Y
; Z- l( I1 u5 ~; C! h
蝣箄 MySQL 芸
0 v9 @+ A. q* `* E5 q) N7 p # chkconfig --list mysqld
3 F" [! `7 e d9 x j6 H( e$ B 憒2--5榣n撠屠K2 D: p3 q( a) R" y2 a/ l: d9 }
mysqld 0: off 1: off 2: on 3: on 4: on 5: on 6: off
$ Q) e h. X" [" s4 { MySQL $ O! u8 x4 o, z* f* D8 H
# 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
0 `5 ^; p' `) v
MySQL 隞亙嚗敹閮剖 root 撖蝣
. I% t: s2 p! r0 h) E6 ^& e # 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 頛詨亙蝣
" E0 P! q1 b8 v+ c4 o) j ?
[啣鋆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
, T( m; |! o( |6 z: P8 Bmysql_install_db --user=mysql --ldata=/var/lib/mysql/ ===>check /var/lib/mysql/批歇撱箇閮勗DB
( @3 H7 Y2 K9 |9 x2 H; v' L
8 L ?4 ~3 n' R% I: q+ b9 p! e
蝝啁: https://www.cadch.com/modules/news/article.php?storyid=227 |