|
亦CentOS芸蒂mysql臬血歇摰鋆: yum list installed | grep mysql 5 E: `. K) S; e
交芸蒂摰鋆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 _+ V& Z) K' ^& ]
亦yum摨思mysql砌縑: yum list | grep mysql yum -y list mysql*
8 v& A1 ?- W) o4 t雿輻肘um摰鋆mysql鞈摨: yum -y install mysql-server mysql mysql-devel 瘜剁摰鋆mysql芣臬鋆鈭鞈摨嚗芣摰鋆mysql-server貊嗡摰鋆鈭serverclient
5 ^ N$ D& v: D" n3 |憒頛詨 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 ! ]& Q" ]# P# N$ S k
閮剖 /etc/my.cnf
; x b6 o, ]9 P1 T( n5 R- I [mysqld]
+ z6 ~" y. t- K3 I ~) h1 c$ a$ U. Cdatadir=/var/lib/mysql
) j' X' C2 y4 H3 D! M0 csocket=/var/lib/mysql/mysql.sock
, r+ X6 R) M8 J: ?# Default to using old password format for compatibility with mysql 3.x
9 b( O7 z& ?, U! [$ `6 N: ^4 E# clients (those using the mysqlclient10 compatibility package).- W6 T# Q9 | o
old_passwords=16 k! l* @# P: E+ Z) I
default-character-set = utf8
# y4 P: O3 A- x7 z: r1 ?3 k# Q; B2 B$ I, B# W1 B9 x* Q s/ L8 ~
[mysql.server]' v w9 Y& s9 B% E6 K! l k
user=mysql, D/ C5 X, F6 ~8 U/ ]
basedir=/var/lib
: v4 R9 e) v6 V: i1 p. W8 ?- t
# t% b- U$ c" ^4 S[mysqld_safe]( G: S/ k' p6 d
log-error=/var/log/mysqld.log
- _# |9 C* R( W* r1 z3 Ipid-file=/var/run/mysqld/mysqld.pid
: \ M3 Y. S0 R U& O: s+ E
5 V1 p' B9 b/ R9 j) w[mysql]
8 A) } O( _! Z8 J! G2 T" d0 Ldefault-character-set = utf8
- X( h( @( s& h% d7 e: C 閮剖 MySQL 函頂蝯曹韏瑕
; P3 W) A3 }. x/ [" z' [) T' r7 |9 j# chkconfig mysqld on
3 b/ {: ^4 K5 w3 E% M
3 k# f- W2 [2 k! G- g: P) A蝣箄 MySQL 芸. r% o% j4 @9 U V3 t+ n- L. k
# chkconfig --list mysqld
1 h- H y T4 `# J 憒2--5榣n撠屠K
4 d0 @: \+ C5 i7 a$ f& ^ mysqld 0: off 1: off 2: on 3: on 4: on 5: on 6: off# O/ d/ P4 r1 s3 M+ t
MySQL * X( z3 y# b& r2 q- W2 j8 O0 H m1 {
# 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
& Z7 W; V- u7 Y
MySQL 隞亙嚗敹閮剖 root 撖蝣
$ ?1 ], i* c" P- f9 \$ u # 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 頛詨亙蝣
. |+ W2 J. E, R7 ]" P9 g+ R
[啣鋆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/鞈摨,甇日撱箇DB2 ]6 N! l/ r. t' W) a+ [( @; Q
mysql_install_db --user=mysql --ldata=/var/lib/mysql/ ===>check /var/lib/mysql/批歇撱箇閮勗DB/ ^5 a& e/ D! @; g1 ~6 n5 C
+ _+ h; n M! [
蝝啁: https://www.cadch.com/modules/news/article.php?storyid=227 |