亦CentOS芸蒂mysql臬血歇摰鋆: yum list installed | grep mysql
* M5 S% W: |# r交芸蒂摰鋆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嚗交憭靘鞈湔隞嗅靘甈∪貉
$ P$ J3 s1 N. B% U2 W @3 K; x亦yum摨思mysql砌縑: yum list | grep mysql yum -y list mysql* # \* f, Z+ `% W0 X& H7 E4 H
雿輻肘um摰鋆mysql鞈摨: yum -y install mysql-server mysql mysql-devel 瘜剁摰鋆mysql芣臬鋆鈭鞈摨嚗芣摰鋆mysql-server貊嗡摰鋆鈭serverclient + Q+ c" Z; g' z; a
憒頛詨 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 9 C( |. |+ w& A6 T# V o/ h
閮剖 /etc/my.cnf
% x$ h# }' [' T9 t [mysqld]1 j; U$ u+ I; j: l" _0 F& x0 I
datadir=/var/lib/mysql
: C- s( y1 {* z- E! R, msocket=/var/lib/mysql/mysql.sock
5 R/ v% f: s$ M: w* ?# Default to using old password format for compatibility with mysql 3.x6 v3 p; ^, [$ ~9 _, O! l
# clients (those using the mysqlclient10 compatibility package).
' ]3 G4 ~* f) H+ n* L6 vold_passwords=1: ]/ @& W1 h3 F/ q" h: u% z
default-character-set = utf8
& Q7 c% `/ y7 }8 Y# w# [- `8 _9 B+ m8 F4 a' @5 p
[mysql.server]( I& [: y4 I# w6 K3 ?0 k
user=mysql9 E2 z0 o/ [$ b0 S' f7 l0 a- T/ ]
basedir=/var/lib" b2 j9 r+ p! Q5 k
# W& ]2 n& r( n+ z5 D
[mysqld_safe]
6 k0 S. Q. V' _( j8 vlog-error=/var/log/mysqld.log
( D8 ^. G' m7 J, g& cpid-file=/var/run/mysqld/mysqld.pid, O! B% e( ~8 P- l# _% |7 Z
4 O+ I2 x) o: F: S[mysql]; v7 g4 L7 Y- b/ E M! i
default-character-set = utf8: y9 g* J% n- u6 D
閮剖 MySQL 函頂蝯曹韏瑕) g! A5 g% F# C) ^, x
# chkconfig mysqld on
/ V6 x- }% V j; c, U6 I. L: L( F# t
蝣箄 MySQL 芸/ w) T/ ]4 T% Y# a1 n: d ^0 b
# chkconfig --list mysqld
6 ?2 c9 d5 u: M5 N 憒2--5榣n撠屠K9 P$ o& a- w9 R3 J+ R
mysqld 0: off 1: off 2: on 3: on 4: on 5: on 6: off* M: f% P" L* M) c7 k
MySQL 8 I, ]7 t5 T$ |% `4 T
# 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 F2 M+ ]& @/ f0 i! V
MySQL 隞亙嚗敹閮剖 root 撖蝣
8 R( K& B1 j" Q/ h! E- v. M # 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 頛詨亙蝣 ! ~: v5 I4 t, d2 t) ]8 a6 F% Y
[啣鋆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
1 A$ {& ~2 S) V' f$ l8 n# l8 amysql_install_db --user=mysql --ldata=/var/lib/mysql/ ===>check /var/lib/mysql/批歇撱箇閮勗DB m+ ?: j* d3 c% m
% Z- S; {9 w4 r2 x) o
蝝啁: https://www.cadch.com/modules/news/article.php?storyid=227 |