LINUX下安装MYSQL,再次重新安装,不知道为什么,以前安装好的又出现莫名其妙的错误
The basic commands you must execute to install and use a MySQL binary
distribution are: www.yippeesoft.com
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /PATH/TO/MYSQL-VERSION-OS.tar.gz &line; tar xvf -
shell> ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql
shell> cd mysql
shell> scripts/mysql_install_db –user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
shell> bin/mysqld_safe –user=mysql &
出现 Starting mysqld daemon with databases from /var/lib/mysql
另外开启一个超级终端登录上去
# mysql
然后你可以看到屏幕显示出以下信息:
Welcome to the MySQL monitor. Commands end with ; or \\g.
Your MySQL connection id is 2 to server version: 3.22.21
Type \’help\’ for help.
mysql>
接着,用show databases命令可以将安装的数据库列出来:
mysql> show databases;
你就可以看到:
+———-+
&line; Database &line;
+———-+
&line; mysql &line;
&line; test &line;
+———-+
2 rows in set (0.00 sec)
如果一切正常的话,那说明MySQL可以完全工作了!恭喜你!如果要退出程序,输入:exit
mysql> exit;
Bye
……………………………………………………………………………………………………………………
下面都是这几天的调试记录~~~
# /usr/sbin/groupadd mysql www.yippeesoft.com
useradd -M -o -r -d /home/sf/www/mysql41 -s /bin/bash -c "MySQL Server" -u 27 mysql
./configure –prefix=/home/sf/www/mysql41 –with-mysqld-user=mysql –with-extra-charsets=all –with-unix-socket-path=/home/sf/www/mysql41/var/mysql.sock
cp /home/sf/www/mysql41/share/mysql/my-medium.cnf /etc/my.cnf
./configure –prefix=/home/sf/www/mysql41 –with-mysqld-user=root –with-extra-charsets=all –with-unix-socket-path=/home/sf/www/mysql41/var/mysql.sock
./configure –prefix=/home/sf/www/mysql41 –with-mysqld-user=sf –with-extra-charsets=all –with-unix-socket-path=/home/sf/www/mysql41/var/mysql.sock
./configure –prefix=/opt/mysql –with-mysqld-user=sf –with-extra-charsets=all –with-unix-socket-path=/opt/mysql/var/mysql.sock www.yippeesoft.com
Remember to check the platform specific part of the reference manual for
hints about installing MySQL on your platform. Also have a look at the
files in the Docs directory.
Thank you for choosing MySQL!
make www.yippeesoft.com
ndb-config-2-node.ini.sh > ndb-config-2-node.ini-t
/bin/mv ndb-config-2-node.ini-t ndb-config-2-node.ini
make[3]: Leaving directory `/home/sf/tmp/mysql-4.1.14/support-files\’
make[2]: Leaving directory `/home/sf/tmp/mysql-4.1.14/support-files\’
make[1]: Leaving directory `/home/sf/tmp/mysql-4.1.14\’
#make install
# cp /home/sf/www/mysql41/my-medium.cnf /etc/my.cnf
# mysql_install_db www.yippeesoft.com
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
[root@mobile mysql41]# ./share/mysql/mysql.server start
Starting MySQL……………………………..[失败]
[root@mobile bin]# ./mysqld_safe www.yippeesoft.com
touch: 正在创建目录 ‘/home/sf/www/mysql41/var/mobile.err’: 没有那个文件或目录
chown: 无法取得 ‘/home/sf/www/mysql41/var/mobile.err’ 的属性: 没有那个文件或目录
Starting mysqld daemon with databases from /home/sf/www/mysql41/var
./mysqld_safe: line 329: /home/sf/www/mysql41/var/mobile.err: 没有那个文件或目录
./mysqld_safe: line 1: /home/sf/www/mysql41/var/mobile.err: 没有那个文件或目录
STOPPING server from pid file /home/sf/www/mysql41/var/mobile.pid
tee: /home/sf/www/mysql41/var/mobile.err: 没有那个文件或目录
050916 15:31:14 mysqld ended
tee: /home/sf/www/mysql41/var/mobile.err: 没有那个文件或目录
[root@mobile bin]# cd .. www.yippeesoft.com
[root@mobile mysql41]# ls
bin include info lib libexec man mysql-test share sql-bench
[root@mobile mysql41]# mkdir var
[root@mobile mysql41]# ./bin/mysqld_safe
Starting mysqld daemon with databases from /home/sf/www/mysql41/var
STOPPING server from pid file /home/sf/www/mysql41/var/mobile.pid
050916 15:31:48 mysqld ended
出错记录 www.yippeesoft.com
050916 15:31:48 mysqld started www.yippeesoft.com
050916 15:31:48 [ERROR] Can\’t start server : Bind on unix socket: Permission denied
050916 15:31:48 [ERROR] Do you already have another mysqld server running on socket: /home/sf/www/mysql41/mysql.sock ?
050916 15:31:48 [ERROR] Aborting
050916 15:31:48 [Note] /home/sf/www/mysql41/libexec/mysqld: Shutdown complete
050916 15:31:48 mysqld ended
# chmod 777 mysql41/ www.yippeesoft.com
# ./share/mysql/mysql.server start
结果~
050916 15:57:54 InnoDB: Started; log sequence number 0 0
050916 15:57:54 [ERROR] /home/sf/www/mysql41/libexec/mysqld: Can\’t find file: \’./mysql/host.frm\’ (errno: 13)
050916 15:57:54 [ERROR] /home/sf/www/mysql41/libexec/mysqld: Can\’t find file: \’./mysql/host.frm\’ (errno: 13) www.yippeesoft.com
050916 15:57:54 [ERROR] Fatal error: Can\’t open privilege tables: Can\’t find file: \’./mysql/host.frm\’ (errno: 13)
050916 15:57:54 mysqld ended www.yippeesoft.com
[root@mobile mysql41]# ./bin/mysqladmin start www.yippeesoft.com
./bin/mysqladmin: connect to server at \’localhost\’ failed
error: \’Can\’t connect to local MySQL server through socket \’/tmp/mysql.sock\’ (2)\’
Check that mysqld is running and that the socket: \’/tmp/mysql.sock\’ exists!
一个MySQL客户可以两种不同的方式连接mysqld服务器:Unix套接字,它通过在文件系统中的一个文件(缺省“/tmp/mysqld.sock”)进行连接;或TCP/IP,它通过一个端口号连接。Unix套接字比TCP/IP更快,但是只有用在连接同一台计算机上的服务器。如果你不指定主机名或如果你指定特殊的主机名localhost,使用Unix套接字。
错误(2002)Can\’t connect to …通常意味着没有一个MySQL服务器运行在系统上或当试图连接mysqld服务器时,你正在使用一个错误的套接字文件或TCP/IP端口。
由检查(使用ps)在你的服务器上有一个名为mysqld的进程启动!如果没有任何mysqld过程,你应该启动一个。见4.15.2 启动MySQL服务器的问题。
[root@mobile bin]# mysql -u root -p
Enter password: www.yippeesoft.com
ERROR 2002: Can\’t connect to local MySQL server through socket \’/var/lib/mysql/mysql.sock\’ (2)
通常,你用3个方法之一启动mysqld服务器:
通过调用mysql.server。这个脚本主要用于系统启动和关闭,更全面的描述在4.15.3 自动启动和停止MySQL。 www.yippeesoft.com
通过调用safe_mysqld,它试图为mysqld决定正确的选项并然后用那些选择运行它。
通过直接调用mysqld。
无论你使用哪个方法启动服务器,如果它没有正确启动,检查日志文件看你是否能发现为什么。
[root@mobile bin]# ./mysqld www.yippeesoft.com
050916 14:33:51 [ERROR] Can\’t find messagefile \’/usr/local/mysql/share/mysql/english/errmsg.sys\’
050916 14:33:51 [ERROR] Aborting
最后决定自从源码重新做起,估计是因为原来的配置文件MY.CNF在作怪~~
历史博文
- wpf显示GIF - 2009
- 蜘蛛屏蔽 - 2009
- 20071205 VTTray.exe 1433 - 2008
- 20070417 cmcc wlan kav kis - 2007
- 0419 Compiler Error C2275 - 2006
- 互联网电子公告服务管理规定 - 2005
- W32.TOXBOT NETDDESRV - 2005