|
[root@ogg mysql]# cd /usr/local/mysql
[root@ogg mysql]# ls
bin COPYING data docs include INSTALL-BINARY lib man mysql-test README scripts share sql-bench support-files
[root@ogg mysql]# chown -R mysql:mysql .
[root@ogg mysql]# ls -l
total 76
drwxr-sr-x 2 mysql mysql 4096 Sep 29 15:32 bin
-rw-r--r-- 1 mysql mysql 17987 Apr 11 2011 COPYING
drwxr-sr-x 4 mysql mysql 4096 Sep 29 15:32 data
drwxr-xr-x 2 mysql mysql 4096 Sep 29 15:32 docs
drwxr-sr-x 3 mysql mysql 4096 Sep 29 15:32 include
-rw-r--r-- 1 mysql mysql 7370 Apr 11 2011 INSTALL-BINARY
drwxr-sr-x 3 mysql mysql 4096 Sep 29 15:32 lib
drwxr-sr-x 4 mysql mysql 4096 Sep 29 15:32 man
drwxr-xr-x 10 mysql mysql 4096 Sep 29 15:32 mysql-test
-rw-r--r-- 1 mysql mysql 2552 Apr 11 2011 README
drwxr-sr-x 2 mysql mysql 4096 Sep 29 15:32 scripts
drwxr-sr-x 27 mysql mysql 4096 Sep 29 15:32 share
drwxr-sr-x 4 mysql mysql 4096 Sep 29 15:32 sql-bench
drwxr-sr-x 2 mysql mysql 4096 Sep 29 15:32 support-files
初始化数据库:
[root@ogg mysql]# 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!
[root@ogg mysql]# chown -R mysql:mysql ./data
[root@ogg mysql]# chmod -R ug+rws .
配置数据库:
[root@ogg mysql]# vi /etc/my.cnf
[mysqld]
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
|
|
|
|
|
|
|