安装MySQL错误归档处理

2016-02-19 18:02 7 1 收藏

最近很多朋友喜欢上设计,但是大家却不知道如何去做,别担心有图老师给你解答,史上最全最棒的详细解说让你一看就懂。

【 tulaoshi.com - 编程语言 】

  今天我升级MYSQL到5.1的时候遇到的。写出来共享以下。

  1、

  [root@localhost mysql]# scripts/mysql_install_db

  Neither host 'localhost.localdomain' nor 'localhost' could be looked up with

  /resolveip

  Please configure the 'hostname' command to return a correct

  hostname.

  If you want to solve this at a later stage, restart this script

  with the --force option

  这个主要是修改/etc/hosts文件

echo "127.0.0.1 localhost.localdomain localhost" /etc/hosts

  然后再初始化数据,如果还是同样的错误,那就直接加--force开关。

  我今天碰到的就是这个情况。

  [root@localhost mysql]# scripts/mysql_install_db --force

  Installing MySQL system tables...

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)

  OK

  Filling help tables...

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)

  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/local/mysql//bin/mysqladmin -u root password 'new-password'

  /usr/local/mysql//bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

  See the manual for more instructions.

  You can start the MySQL daemon with:

  cd . ; /usr/local/mysql//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!

  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

  这样就成功初始化数据了。

  2、编码文件链接丢失。

[root@localhost mysql]# scripts/mysql_install_db --force
Installing MySQL system tables...
071129 13:38:08 [ERROR] Can't find messagefile '/usr/local/mysql/share/english/errmsg.sys'
071129 13:38:08 [ERROR] Aborting

071129 13:38:08 [Note]
Installation of system tables failed!

Examine the logs in /usr/local/mysql/data/ for more information.
You can try to start the mysqld daemon with:
/usr/local/mysql//bin/mysqld --skip-grant &
and use the command line tool
/usr/local/mysql//bin/mysql to connect to the mysql
database and look at the grant tables:

shell /usr/local/mysql//bin/mysql -u root mysql
mysql show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /usr/local/mysql/data/ that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the ./bin/mysqlbug script!

  解决:

  今天发现MYSQL官方5.1.22 对这个BUG进行了修正。

  mysql_install_db could fail to find its message file. (Bug#30678)

  [root@localhost mysql]# ln -s /usr/local/mysql/share/mysql/english/ /usr/local/mysql/share/english

  [root@localhost mysql]# scripts/mysql_install_db --force

  Installing MySQL system tables...

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)

  OK

  Filling help tables...

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)

  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/local/mysql//bin/mysqladmin -u root password 'new-password'

  /usr/local/mysql//bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

  See the manual for more instructions.

  You can start the MySQL daemon with:

  cd . ; /usr/local/mysql//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!

  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

  正常启动

[root@localhost mysql]# /usr/local/mysql/bin/mysqld_safe &
[1] 2680
[root@localhost mysql]# 071129 13:45:16 mysqld_safe Logging to '/usr/local/mysql/data//localhost.localdomain.err'.
/usr/local/mysql/bin/mysqld_safe: line 366: [: -eq: unary operator expected
071129 13:45:16 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data/
ps aux | grep mysql
root   2680 0.0 0.1  4684 1144 pts/0  S  13:45  0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe
nobody  2748 1.6 1.7 108948 16796 pts/0  Sl  13:45  0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ --user=nobody --log-error=/usr/local/mysql/data//localhost.localdomain.err --pid-file=/usr/local/mysql/data//localhost.localdomain.pid --socket=/tmp/mysql.sock --port=3306
root   2762 0.0 0.0  4120  668 pts/0  S+  13:45  0:00 grep mysql


  2、用 mysqldumpshow时遇到的错误:

[root@localhost bin]# mysqldumpslow
Can't determine basedir from 'my_print_defaults mysqld' output: --max-allowed-packet=100M
export PATH=$PATH:/usr/local/mysql/bin

  就可以解决。

来源:http://www.tulaoshi.com/n/20160219/1616673.html

延伸阅读
可得到几种版本的MySQL分发包。当前稳定的发行版有3.22 版本系列。当前正在开发的版本为3.23 系列。一般,应该使用系列中最高编号的版本。 MySQL分发包可以以二进制代码、RPM 和源代码的格式得到。二进制代码和RPM 分发包容易安装,但必须接受建立在分发包内的安装设计和缺省配置。源代码分发包安装很困难,因为必须对软件进行编译,...
可在Windows 95、Windows 98 或Windows NT 下运行MySQL。为了做到这一点,必须安装TCP/IP 支持环境,而且Winsock 软件必须至少为版本2。 在Windows 下可安装两种软件: 独立程序,如为UNIX 安装的那种程序( mysqld 服务器与诸如m s y q l和mysladmin 这样的程序)。 M y ODBC,允许其他程序(如A c c e s s)与MySQL服务器...
此附录介绍怎样获得和安装运行MySQL所需的软件和本书中介绍的第三方软件,如Perl DBI 和CGI.pm 支持环境、PHP、Apache 等。此附录中还说明了怎样获得与本书所用的samp_db 数据库样例有关的文件。 本章的目的是将所有程序包的安装说明汇集在一起,但不取代各程序包附带的安装说明。事实上,我们鼓励阅读随程序包附带的说明。此附录提供...
6.8 其他主题 本节包括几个主题,这些主题不完全适合于本章从client1到client5 的开发中的任一小节的内容: ■ 在使用结果集元数据帮助验证这些数据适合于计算之后,使用结果集数据计算结果。 ■ 如何处理很难插入到查询中的数据。 ■ 如何处理图形数据。 ■ 如何获得表结构的信息。 ■ 常见的MySQL程序设...
标签: ASP
       ASP是非常简单的,以至于许多的开发者不会去思考错误处理。错误处理能够让你的应用程序更加合理。我看到过很多个用ASP编写的商业网站,大多数都忽略了错误处理。   错误的类型   有三种主要的错误类型:   编译错误:   这种错误出现一般都是代码的语法...

经验教程

509

收藏

60
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部