|
楼主 |
发表于 2008-11-16 01:37:27
|
显示全部楼层
参考LinuxQuestion.org的帖子弄好了
bash-3.1# su mysql
bash-3.1# mysql_install_db
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:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h Vecter 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 mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
bash-3.1# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
bash-3.1# cd /var/lib/mysql/
bash-3.1# ls
Vecter.err ib_logfile0 ib_logfile1 ibdata1 mysql test
bash-3.1# ls -al
total 20548
drwxr-x--- 4 mysql mysql 4096 2008-11-16 08:54 .
drwxr-xr-x 19 root root 4096 2008-11-16 00:23 ..
-rw-rw---- 1 mysql root 8263 2008-11-16 08:44 Vecter.err
-rw-rw---- 1 mysql mysql 5242880 2008-11-16 08:44 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 2008-11-14 08:15 ib_logfile1
-rw-rw---- 1 mysql mysql 10485760 2008-11-14 08:15 ibdata1
drwx------ 2 root root 4096 2008-11-16 08:54 mysql
drwx------ 2 root root 4096 2008-11-16 08:54 test
bash-3.1# chown -R mysql.mysql mysql
bash-3.1# ls
Vecter.err ib_logfile0 ib_logfile1 ibdata1 mysql test
bash-3.1# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
bash-3.1# ls -al
total 20548
drwxr-x--- 4 mysql mysql 4096 2008-11-16 08:54 .
drwxr-xr-x 19 root root 4096 2008-11-16 00:23 ..
-rw-rw---- 1 mysql root 8263 2008-11-16 08:44 Vecter.err
-rw-rw---- 1 mysql mysql 5242880 2008-11-16 08:44 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 2008-11-14 08:15 ib_logfile1
-rw-rw---- 1 mysql mysql 10485760 2008-11-14 08:15 ibdata1
drwx------ 2 mysql mysql 4096 2008-11-16 08:54 mysql
drwx------ 2 root root 4096 2008-11-16 08:54 test
bash-3.1# cd /etc/rc.d/
bash-3.1# ls
init.d rc.dnsmasq rc.modules-2.6.24.5 rc.sysvinit
rc.0 rc.font.new rc.modules-2.6.24.5-smp rc.udev
rc.4 rc.fuse rc.mysqld rc.wireless
rc.6 rc.gpm rc.nfsd rc.wireless.conf
rc.K rc.hald rc.ntpd rc.yp
rc.M rc.httpd rc.pcmcia rc0.d
rc.S rc.inet1 rc.rpc rc1.d
rc.acpid rc.inet1.conf rc.samba rc2.d
rc.alsa rc.inet2 rc.saslauthd rc3.d
rc.atalk rc.inetd rc.sendmail rc4.d
rc.bind rc.ip_forward rc.serial rc5.d
rc.bluetooth rc.local rc.snmpd rc6.d
rc.bluetooth.conf rc.messagebus rc.sshd
rc.cups rc.modules rc.syslog
bash-3.1# ls -al rc.m
rc.messagebus rc.modules-2.6.24.5 rc.mysqld
rc.modules rc.modules-2.6.24.5-smp
bash-3.1# ls -al rc.mysqld
-rwxr-xr-x 1 root root 2585 2008-04-29 05:54 rc.mysqld
bash-3.1# ./rc.mysqld start
bash-3.1# nohup: redirecting stderr to stdout
Starting mysqld daemon with databases from /var/lib/mysql
bash-3.1# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.51b Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> |
|