-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3650字,纯文字阅读大概需要6分钟。
内容图文
安装完成后,初始化数据库报错如下:
[root@localhost mysql]# ./scripts/mysql_install_db --user=mysql
-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file or
directory
貌似提示注释器错误,没有/usr/bin/perl文件或者档案,解决办法(安装perl跟perl-devel即可):
执行 yum -y install perl perl-devel
后在初始化数据库即可。
启动mysql报错如下:
[root@localhost mysql]# /etc/init.d/mysqld start
Starting MySQL.............. ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).
查看日志文件有以下错误日志:
2013-08-08 13:07:44 21805 [ERROR] Fatal error: Can‘t open and lock privilege tables: Table ‘mysql.user‘ doesn‘t exist
130808 13:07:45 mysqld_safe mysqld from pid file /var/lib/mysql/localhost.localdomain.pid ended
解决办法:cp ./support-files/my-default.cnf /etc/my.cnf 后再重启即可
根据度娘的结果,有大虾说是机器内存的问题,我在这里贴出其解决方案:
查看日志文件,看看有什么提示!
生成my.cnf
sudo cp support-files/my-medium.cnf /etc/my.cnf
#下面是安装使用过程中出现的一些问题及解决方法
一.不能用root用户运程连接mysql
*******************************************************************************
为MySQL的root用户添加远程访问权限:
[root@localhost ~]# mysql -uroot -p
Enter password: (此处输入密码登录)
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 35 to server version: 5.0.22
Type ‘help;‘ or ‘/h‘ for help. Type ‘/c‘ to clear the buffer.
mysql> grant all on *.* to root@‘%‘ identified by ‘your_password‘;
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye
[root@localhost ~]# /etc/init.d/mysqld restart
*******************************************************************************
二.Mysqld启动失败
*******************************************************************************
1) mysql相关进程僵死
查找mysql相关进程:sudo ps ?A | grep mysql
杀死相关进程:sudo kill -9 process_id
重启mysqld:sudo /etc/init.d/mysqld restart
2)优化后出现
Starting MySQL..The server quit without updating PID file ([失败]ocal/mysql/data/localhost.localdomain.pid).
这个问题主要出现的原因是因为my.cnf的配置过于高,当前的机器无法满足,导致了MYSQL启动失败,估计以后也会有很多人遇到这个问题,网上的标准是:
如果内存是128M,则复制/usr/local/share/mysql/my-medium.cnf为/etc/my.cnf
# 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)
如果内存是512M,则复制/usr/local/share/mysql/my-large.cnf为/etc/my.cnf
# This is for a large system with memory = 512M where the system runs mainly
# MySQL.
如果内存是1-2G,则复制/usr/local/share/mysql/my-huge.cnf为/etc/my.cnf
# This is for a large system with memory of 1G-2G where the system runs mainly
# MySQL.
实际上需要在my-medium.cnf的基础上进行修改,增强部分配置,不能直接使用my-large.cnf和my-huge.cnf。
除非你的服务器配置相当高。
3)./mysql-bin.index not found
权限问题修改数据目录的权限及/usr/local/mysql/bin/mysqld 的权限。
4)Error Code : 1418
This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
(0 ms taken)
解决方法如下:
1. mysql> SET GLOBAL log_bin_trust_function_creators = 1;
2. 在my.ini(linux下为my.conf)文件中 [mysqld] 标记后加一行内容为 log-bin-trust-function-creators=1
http://blog.chinaunix.net/space. ... blog&id=2435868
-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file
标签:mysql
本文系统来源:http://linuxzqdn.blog.51cto.com/6158930/1751358
内容总结
以上是互联网集市为您收集整理的-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file全部内容,希望文章能够帮你解决-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。