wsjz_01 发表于 2018-10-2 10:35:46

Mysql学习之--卸载源码mysql-5.6安装mysql-5.5

# cd /usr/local/mysql  
# ls
  
binCOPYINGdatadocsincludeINSTALL-BINARYlibmanmysql-testREADMEscriptssharesql-benchsupport-files
  

  
# chown -R mysql:mysql .
  
# ls -l
  
total 76
  
drwxr-sr-x2 mysql mysql4096 Sep 29 15:32 bin
  
-rw-r--r--1 mysql mysql 17987 Apr 112011 COPYING
  
drwxr-sr-x4 mysql mysql4096 Sep 29 15:32 data
  
drwxr-xr-x2 mysql mysql4096 Sep 29 15:32 docs
  
drwxr-sr-x3 mysql mysql4096 Sep 29 15:32 include
  
-rw-r--r--1 mysql mysql7370 Apr 112011 INSTALL-BINARY
  
drwxr-sr-x3 mysql mysql4096 Sep 29 15:32 lib
  
drwxr-sr-x4 mysql mysql4096 Sep 29 15:32 man
  
drwxr-xr-x 10 mysql mysql4096 Sep 29 15:32 mysql-test
  
-rw-r--r--1 mysql mysql2552 Apr 112011 README
  
drwxr-sr-x2 mysql mysql4096 Sep 29 15:32 scripts
  
drwxr-sr-x 27 mysql mysql4096 Sep 29 15:32 share
  
drwxr-sr-x4 mysql mysql4096 Sep 29 15:32 sql-bench
  
drwxr-sr-x2 mysql mysql4096 Sep 29 15:32 support-files
  

  
初始化数据库:
  
# scripts/mysql_install_db --user=mysql
  
Installing MySQL system tables...
  
OK
  
Filling help tables...
  
OK
  
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:
  
./bin/mysqladmin -u root password 'new-password'
  
./bin/mysqladmin -u root -h ogg password 'new-password'
  
Alternatively you can run:
  
./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 . ; ./bin/mysqld_safe &
  
You can test the MySQL daemon with mysql-test-run.pl
  
cd ./mysql-test ; perl mysql-test-run.pl
  
Please report any problems with the ./bin/mysqlbug script!
  

  
# chown -R mysql:mysql ./data
  
# chmod -R ug+rws .
  

  
配置数据库:
  
# vi /etc/my.cnf
  

  
port            = 3306
  
socket          = /tmp/mysql.sock
  
skip-external-locking
  
key_buffer_size = 16M
  
max_allowed_packet = 1M
  
table_open_cache = 64
  
sort_buffer_size = 512K
  
net_buffer_length = 8K
  
read_buffer_size = 256K
  
read_rnd_buffer_size = 512K
  
myisam_sort_buffer_size = 8M
  
user=mysql
  
datadir=/var/lib/mysql
  
default-storage-engine=MyISAM


页: [1]
查看完整版本: Mysql学习之--卸载源码mysql-5.6安装mysql-5.5