安装MySQL错误归档处理

来源:www.phpq.net 时间:2008-12-22 14:50:00 

今天我升级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...

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/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...

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/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

就可以解决。

标签:
0
投稿

猜你喜欢

  • python中Django文件上传方法详解

    2021-12-31 13:40:41
  • python批量替换页眉页脚实例代码

    2022-09-09 11:02:29
  • python解决OpenCV在读取显示图片的时候闪退的问题

    2022-04-16 16:29:48
  • Python实现读取文件夹按数字排序功能

    2023-08-24 02:12:45
  • 绿色下划线的简洁CSS导航代码

    2007-09-17 12:51:00
  • python读写xml文件实例详解嘛

    2023-03-29 13:04:33
  • python 自定义异常和主动抛出异常(raise)的操作

    2022-03-22 12:43:22
  • 使用K.function()调试keras操作

    2022-08-03 05:07:31
  • pygame实现方块动画实例讲解

    2022-11-01 13:37:46
  • 利用python解决mysql视图导入导出依赖的问题

    2023-10-28 07:27:38
  • 520使用Python实现“我爱你”表白

    2022-07-16 05:25:47
  • python实现简单socket程序在两台电脑之间传输消息的方法

    2021-04-25 21:14:26
  • Python查找最长不包含重复字符的子字符串算法示例

    2021-05-25 23:05:02
  • js获取 type=radio 值的方法

    2024-04-29 13:18:38
  • Python subprocess模块功能与常见用法实例详解

    2021-08-30 02:46:43
  • python 多进程队列数据处理详解

    2022-04-10 23:49:44
  • JS复制特定内容到粘贴板

    2011-04-02 11:09:00
  • 如何正确使用开源项目?

    2023-01-29 22:14:57
  • 使用Pyhton集合set()实现成果查漏的例子

    2023-10-20 17:49:00
  • 在django项目中,如何单独运行某个python文件

    2023-04-27 07:37:22
  • asp之家 网络编程 m.aspxhome.com