免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 7729 | 回复: 22
打印 上一主题 下一主题

求助,mysql无法启动 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-06-03 23:28 |只看该作者 |倒序浏览
[root@ee mysql]# mysqld start
090603 22:48:02 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=ee-bin' to avoid this problem.
mysqld: Table 'mysql.plugin' doesn't exist
090603 22:48:02 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
InnoDB: Could not open or create data files.
InnoDB: If you tried to add new data files, and it failed here,
InnoDB: you should now edit innodb_data_file_path in my.cnf back
InnoDB: to what it was, and remove the new ibdata files InnoDB created
InnoDB: in this failed attempt. InnoDB only wrote those files full of
InnoDB: zeros, but did not yet use them in any way. But be careful: do not
InnoDB: remove old data files which contain your precious data!
090603 22:48:02 [ERROR] Plugin 'InnoDB' init function returned error.
090603 22:48:02 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
mysqld: Too many arguments (first extra is 'start').
Use --verbose --help to get a list of available options
090603 22:48:02 [ERROR] Aborting
090603 22:48:02 [Warning] Forcing shutdown of 1 plugins
090603 22:48:02 [Note] mysqld: Shutdown complete

这应该怎么办

论坛徽章:
0
2 [报告]
发表于 2009-06-03 23:32 |只看该作者

my.cnf文件内容

# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /usr/local/mysql/var) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MySQL clients

[client]
default-character-set = utf8
#password       = your_password
port            = 3306

#socket         = /tmp/mysql.sock
socket    = /var/lib/mysql/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
user = mysql
default-character-set = utf8
port            = 3306
socket          = /usr/local/mysql/lib/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
# Replication Master Server (default)
# binary logging is required for replication
log-bin
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id       = 1
# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).
#
#    Example:
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later
#    change in this file to the variables' values below will be ignored and
  #    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.
#    For that reason, you may want to leave the lines below untouched
#    (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id       = 2
#
# The replication master for this slave - required
#master-host     =   <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user     =   <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password =   <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port     =  <port>
#
# binary logging - not required for slaves, but recommended
#log-bin

# Point the following paths to different dedicated disks
#tmpdir         = /tmp/
#log-update     = /path-to-dedicated-directory/hostname
# Uncomment the following if you are using BDB tables
#bdb_cache_size = 4M
#bdb_max_lock = 10000
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /usr/local/mysql/var/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /usr/local/mysql/var/
#innodb_log_arch_dir = /usr/local/mysql/var/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
bind-address=0.0.0.0

[mysqld_safe]
err_log = /var/log/mysqld.log
#pid_file = /var/run/mysqld.pid

论坛徽章:
9
每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00数据库技术版块每周发帖之星
日期:2016-03-07 16:30:25
3 [报告]
发表于 2009-06-04 00:04 |只看该作者
原帖由 myr 于 2009-6-3 23:28 发表
[root@ee mysql]# mysqld start
090603 22:48:02 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master  ...

关键是这句
[ERROR] Can't open the mysql.plugin table.
修改mysql下的data目录的权限,然后再执行
mysql_install_db --datadir=/usr/local/mysql --user=mysql
其中/usr/local/mysql是mysql数据文件存放的位置

论坛徽章:
0
4 [报告]
发表于 2009-06-04 00:19 |只看该作者
日志这么长,没用就别贴出来了,看了都头晕
楼上是牛人~

论坛徽章:
0
5 [报告]
发表于 2009-06-04 09:14 |只看该作者
原帖由 cenalulu 于 2009-6-4 00:04 发表

关键是这句
[ERROR] Can't open the mysql.plugin table.
修改mysql下的data目录的权限,然后再执行
mysql_install_db --datadir=/usr/local/mysql --user=mysql
其中/usr/local/mysql是mysql数据文件存 ...


mysql下没有data目录

还有,我原来有正在使用的数据库,可以在mysql_install_db --datadir=/usr/local/mysql --user=mysql 吗?????
[root@ee mysql]# ll
总用量 40
drwxr-xr-x    2 mysql    root         4096  6月  3 20:14 bin
drwxr-xr-x    2 mysql    root         4096  5月 31 20:24 docs
drwxr-xr-x    3 mysql    root         4096 2005-10-07  include
drwxr-xr-x    2 mysql    root         4096 2005-10-08  info
drwxr-xr-x    3 mysql    root         4096  6月  3 09:42 lib
drwxr-xr-x    2 mysql    root         4096  5月 31 20:25 libexec
drwxr-xr-x    3 mysql    root         4096 2005-10-07  man
drwxr-xr-x   10 mysql    root         4096  5月 31 20:25 mysql-test
drwxr-xr-x    5 mysql    root         4096  5月 31 19:23 share
drwxr-xr-x    5 mysql    root         4096  5月 31 20:25 sql-bench

[ 本帖最后由 myr 于 2009-6-4 09:15 编辑 ]

论坛徽章:
9
每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00数据库技术版块每周发帖之星
日期:2016-03-07 16:30:25
6 [报告]
发表于 2009-06-04 12:34 |只看该作者
原帖由 myr 于 2009-6-4 09:14 发表


mysql下没有data目录

还有,我原来有正在使用的数据库,可以在mysql_install_db --datadir=/usr/local/mysql --user=mysql 吗?????
[root@ee mysql]# ll
总用量 40
drwxr-xr-x    2 mysql    ro ...


那也就是说你做的是升级mysql的操作咯?
那就按照提示所说的[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
运行一下mysql_upgrade,具体的参数可以man一下。

还有[ERROR] Do you already have another mysqld server running on socket: /usr/local/mysql/lib/mysql.sock ?
你没有把原来的那个数据库关掉?就执行更新操作了?

论坛徽章:
0
7 [报告]
发表于 2009-06-04 12:54 |只看该作者
[root@ee root]# mysql_install_db --datadir=/usr/local/mysql/var --user=mysql
Installing MySQL system tables...
090604 11:59:51 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=ee-bin' to avoid this problem.
ERROR: 1036  Table 'db' is read only
090604 11:59:52 [ERROR] Aborting
090604 11:59:52 [Warning] Forcing shutdown of 2 plugins
090604 11:59:52 [Note] /usr/sbin/mysqld: Shutdown complete

Installation of system tables failed!  Examine the logs in
/usr/local/mysql/var for more information.
You can try to start the mysqld daemon with:
    shell> /usr/sbin/mysqld --skip-grant &
and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:
    shell> /usr/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/var 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 are the
MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before mailing us!  And remember, if
you do mail us, you MUST use the /usr/bin/mysqlbug script!

论坛徽章:
0
8 [报告]
发表于 2009-06-04 12:59 |只看该作者
原帖由 cenalulu 于 2009-6-4 12:34 发表


那也就是说你做的是升级mysql的操作咯?
那就按照提示所说的[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
运行一下mysql_upgrade,具体的参数可以man一下。

还 ...


老大,我是帮别人看,我对mysql不太会
开始问题好像是硬盘没有空间了
然后被人把数据库移走了,包括错误日志
后来又然装了一个mysql,位置在/use/local/mysql2
现在搞不好了,我接手了

论坛徽章:
9
每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00数据库技术版块每周发帖之星
日期:2016-03-07 16:30:25
9 [报告]
发表于 2009-06-04 15:34 |只看该作者
那也就是说你有现成的数据库文件,只是新装了一个mysql?
那么你至少要把my.cnf里的datadir 配置到原来的数据文件夹的位置。

还有就是你新装的mysql版本跟原来一样么?

论坛徽章:
0
10 [报告]
发表于 2009-06-04 16:17 |只看该作者
新装了一个,路径还不一样,版本不知道一样不
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP