数据库

位置:IT落伍者 >> 数据库 >> 浏览文章

linux下mysql远程连接


发布日期:2024年07月23日
 
linux下mysql远程连接

对大家推荐很好使用的Linux mysql系统像让大家对Linux mysql系统有所了解然后对Linux mysql系统全面讲解介绍希望对大家有用今天特意配置了mysql apache php 虽然网上很多这方面的例子但是很多是作者再回忆写的所以难免有笔误的地方而这些东西正是新手很困惑的地方一下是我的安装笔记在Centos虚拟机上安装成功中文的参考英文的参考 How to Install MySQL on LinuxHow to Install PHP on Linux How to Install Apache on Linux

Linux mysqlapache php 安装过程将apache mysql php 的targz 文件复制到/home/tmp目录接着执行下面的命令

Linux mysql 安装

cd /home/tmp

groupadd mysql

useradd g mysql mysql

tar zxvf mysqltargz

cd mysql

/configure prefix=/usr/local/mysql

make

make install

cd /usr/local/mysql

chown R root

bin/mysql u root p

chgrp R mysql (注意有个

cd /home/tmp

cd mysql

ln s /usr/local/mysql/ /usr/local/mysql

cp supportfiles/f /etc/f

修改f 在[sqld]下面添加user=mysql

chown root /etc/f

chgrp root /ect/f

chmod /etc/f

/usr/local/mysql/bin/mysqld_safe user=mysql &

cp supportfiles/mysqlserver /etc/initd/mysql

chmod /etc/initd/mysql

chkconfig add mysql

chkconfig level mysql on

/usr/local/mysql/bin/mysql_install_db user=mysql

/usr/local/mysql/bin/mysql u root(如果能进入mysql 命令行说明mysql 配置成功)

edit /etc/f

[client] + defaultcharacterset=utf [mysqld] + defaultcharacterset=utf [mysql] + defaultcharacterset=utf

apache安装请先进入/home/tmp目录(cd /home/tmp)

tar zxvf

cd  prefix=/usr/local/apache enableso enablerewrite enableauthdigest=shared enablessl enabledeflate

make

history

make install

cp /usr/local/apache/bin/apachectl /etc/initd

chmod /etc/initd/apachectl

/usr/local/apache/bin/apachectl start

php的安装

cd /home/tmp

tar xzf phptargz

cd php

/configure prefix=/usr/local/php \

withapxs=/usr/local/apache/bin/apxs \

withmysql=/usr/local/mysql \

withpdomysql \

withzlib \

withlibxmldir \

withxsl \

enablembstring \

enablezendmultibyte \

enablesockets \

enablesoap \

enablezip

Linux mysql

make install修改apache (apache/conf/)添加如下部分LoadModule php_module modules/libphpso AddType application/x

cp phpinidevelopment /usr/local/php/lib/phpini

/usr/local/apache/bin/apachectl start

/usr/local/apache/bin/apachectl stop

/usr/local/apache/bin/apachectl start

Linux mysql 允许远程连接

/usr/local/mysql/bin/mysql u root p (进入mysql)

use mysql;

SELECT `Host``User` FROM user;

UPDATE user SET `Host` = % WHERE `User` = root LIMIT ;

flush privileges;

注意在mysql 命令行形式下一定要输入;

v经过configure就可以make了

Linux mysql

make install注意pdo_mysql的全路径我的是

/usr/local/php/lib/php/extensions/debugnonzts/pdo_mysqlso

然后在/usr/local/lib/phpini

加上一句

extension=/usr/local/php/lib/php/extensions/debugnonzts/pdo_mysqlso

重新启动apache即可看到已经加载pdo_mysql成功

               

上一篇:MySQL中文参考手册-- 输入查询

下一篇:MySQL忘记root密码的正确解决办法描述