【安装】LAMP MySQL不知到安装到哪里去了。yum install mysql-server

php中文网
发布: 2016-06-23 13:41:13
原创
937人浏览过

安装LAMP环境,服务器是CentOS(VM虚拟机上搭建的),自带有MYSQL。
也可以所以用yum命令直接安装mysql

yum install mysqlyum install mysql-serveryum install mysql-devel
登录后复制


然后查看所在位置:
[root@localhost php-5.5.13]# whereis mysqlmysql: /usr/bin/mysql /usr/lib64/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz[root@localhost php-5.5.13]# which mysql/usr/bin/mysql[root@localhost php-5.5.13]# pwd/home/default7/Downloads/php-5.5.13[root@localhost php-5.5.13]# [root@localhost php-5.5.13]# find / -name my.cnf/etc/my.cnf[root@localhost php-5.5.13]# pwd/home/default7/Downloads/php-5.5.13[root@localhost php-5.5.13]# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/share/mysql
登录后复制


运行最末尾报错(最末尾几段):
checking whether to enable multibyte string support... nochecking whether to enable multibyte regex support... yeschecking whether to check multibyte regex backtrack... yeschecking for external libmbfl... nochecking for external oniguruma... nochecking for mcrypt support... nochecking for MSSQL support via FreeTDS... nochecking for MySQL support... yeschecking for specified location of the MySQL UNIX socket... noconfigure: error: Cannot find MySQL header files under /usr/share/mysql.Note that the MySQL client library is not bundled anymore!
登录后复制


Apache\PHP都已经安装好,就是MYsql不知到哪里去来 --with-mysql=这个路径我把 whereis mysql里面的每一个都试了都mysql错。mysql到底装到哪里去了。

configure: error: Cannot find MySQL header files under /usr/share/mysql.
Note that the MySQL client library is not bundled anymore!



/usr/share/mysql 文件夹内容
[root@localhost mysql]# whereis mysqlmysql: /usr/bin/mysql /usr/lib64/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz[root@localhost mysql]# cd /usr/share/mysql[root@localhost mysql]# lscharsets              my-innodb-heavy-4G.cnfconfig.huge.ini       my-large.cnfconfig.medium.ini     my-medium.cnfconfig.small.ini      my-small.cnfczech                 mysql_fix_privilege_tables.sqldanish                mysql_system_tables_data.sqldutch                 mysql_system_tables.sqlenglish               mysql_test_data_timezone.sqlerrmsg.txt            norwegianestonian              norwegian-nyfill_help_tables.sql  polishfrench                portuguesegerman                romaniangreek                 russianhungarian             serbianitalian               slovakjapanese              spanishkorean                swedishmy-huge.cnf           ukrainian[root@localhost mysql]# cd binbash: cd: bin: No such file or directory[root@localhost mysql]# 
登录后复制




知了zKnown
知了zKnown

知了zKnown:致力于信息降噪 / 阅读提效的个人知识助手。

知了zKnown 65
查看详情 知了zKnown

回复讨论(解决方案)

用whereis之类的命令找

[root@localhost php-5.5.13]# which mysql

/usr/bin/mysql

不是告诉你mysql在/usr/bin/mysql吗?为什么还要用/usr/share/mysql?


其实新版的不需要指定mysql地址。直接使用--with-mysql即可。

 Cannot find MySQL header files   

这是由于安装mysql时没有安装mysql头文件,或者是路径指定不正确,php找不到mysql的头文件引起的错误提示。

执行下
find / -name "mysql"

其实新版的不需要指定mysql地址。直接使用--with-mysql即可。


一句话解决所有问题!好回答!
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号