本文共 1122 字,大约阅读时间需要 3 分钟。
# 如果MYSQL安装成功,就会有my-medium.cnf
cp /usr/local/src/mysql-5.5.17/support-files/my-medium.cnf
/etc/my.cnf
# 设置权限
chmod +x /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql
# 配置开机自启动
cp support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
# 修改my.cnf配置
vim /etc/my.cnf
# [mysqld] 添加:
datadir=/usr/local/mysql/data
default-storage-engine=MyISAM
# 初始化数据库
/usr/local/mysql/scripts/mysql_install_db --user=mysql
--basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
&
# 启动MySQL
/usr/local/mysql/bin/mysqld_safe –defaults-file=/etc/my.cnf
&
或者:
/etc/init.d/mysqld start (service mysqld start)
# 测试MySQL是否启动
# 1)查看是否有进程mysql
ps -ef | grep mysql
# 2)查看端口是否运行
netstat -tnl | grep 3306
# 3)读取mysql版本信息
/usr/local/mysql/bin/mysqladmin version
# 4) 登录mysql
/usr/local/mysql/bin/mysql -u root
# 至此,MySQL安装完成
解压: httpd.tar.gz tar -zxf httpd.tar.gz
配置:
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql
安装:
make && make install
快速启动配置:
ln -s /usr/local/apache/bin/apachectl /sbin/apache
apache
start|stop|restart
转载地址:https://blog.csdn.net/weixin_33744799/article/details/114020948 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!