对于如何在官网上下载Linux版本的MySQL安装包感兴趣的读者,本文将提供您所需要的所有信息,并且为您提供关于linuxmysql5.6版本的安装配置过程、linuxmysql安装、linux–为现
对于如何在官网上下载Linux版本的MySQL安装包感兴趣的读者,本文将提供您所需要的所有信息,并且为您提供关于linux mysql5.6版本的安装配置过程、linux mysql安装、linux – 为现有的MySQL安装配置PHP、linux 上安装多个不同版本的mysql 踩的坑的宝贵知识。
本文目录一览:- 如何在官网上下载Linux版本的MySQL安装包
- linux mysql5.6版本的安装配置过程
- linux mysql安装
- linux – 为现有的MySQL安装配置PHP
- linux 上安装多个不同版本的mysql 踩的坑
如何在官网上下载Linux版本的MySQL安装包
参考百度经验,《如何在官网上下载Linux版本的MySQL安装包》
原文链接:https://jingyan.baidu.com/article/00a07f3806e5f582d128dc7d.html。
有图有描述,大家可以去原链接查看。
(1)搜索MysqL,打开MysqL官网,跳转网址:【https://dev.MysqL.com/】。(2)点击顶部的下载,【DOWNLOADS】,跳转网址:【https://www.MysqL.com/downloads/】。(3)点击顶部的社区,【Community】,跳转网址:【https://dev.MysqL.com/downloads/】。(4)点击中间列表的第一项【MysqL Community Server 】,跳转网址:【https://dev.MysqL.com/downloads/MysqL/】。(5)把页面往下拉到中,选择操作系统,linux的一般选择【Linux - Generic】,然后选择32位还是64位。(6)如果当前列表版本不是想要的,可以点击右侧的【Looking for the latest GA version?】,选择之前的版本。(7)选择版本后点击版本右侧的【download】,跳转到最后的下载页面。(8)页面上有登录【Login】按钮、注册【Sign Up】按钮,可以选择下面的【No thanks,just start my download】直接下载。
linux mysql5.6版本的安装配置过程
从今年3月份开始MysqL官网开始发布相关的5.6系列的各个版本,对于MysqL5.6系列的版本对一起的版本进行了全局性的细节性加强;个人感觉,以下是在虚拟机中配置的MysqL5.6.10源码安装的过程分享记录下:[root@MysqL5 ~]# groupadd MysqL
[root@MysqL5 ~]# useradd -r -g MysqL MysqL
[root@MysqL5 ~]# ls
anaconda-ks.cfg install.log install.log.syslog mysql-5.6.10.tar.gz
[root@MysqL5 ~]# cd /usr/local/
[root@MysqL5 local]# ls
bin etc games include lib libexec sbin share src
[root@MysqL5 local]# cp /root/mysql-5.6.10.tar.gz /usr/local/
[root@MysqL5 local]# ll
total 34468
drwxr-xr-x 2 root root 4096 Jan 27 2010 bin
drwxr-xr-x 2 root root 4096 Jan 27 2010 etc
drwxr-xr-x 2 root root 4096 Jan 27 2010 games
drwxr-xr-x 2 root root 4096 Jan 27 2010 include
drwxr-xr-x 2 root root 4096 Jan 27 2010 lib
drwxr-xr-x 2 root root 4096 Jan 27 2010 libexec
-rw-r--r-- 1 root root 35174149 Apr 17 00:55 mysql-5.6.10.tar.gz
drwxr-xr-x 2 root root 4096 Jan 27 2010 sbin
drwxr-xr-x 4 root root 4096 Apr 17 00:32 share
drwxr-xr-x 2 root root 4096 Jan 27 2010 src
[root@MysqL5 local]# tar -zxvf mysql-5.6.10.tar.gz
[root@MysqL5 local]# cd mysql-5.6.10
cmake .
make && make install
[root@MysqL5 mysql-5.6.10]# chown -R MysqL.MysqL /usr/local/MysqL
[root@MysqL5 mysql-5.6.10]#
[root@MysqL5 mysql-5.6.10]# cd /usr/local/MysqL/scripts/
[root@MysqL5 scripts]# ./MysqL_install_db --user=MysqL --basedir=/usr/local/mys
ql --datadir=/usr/local/MysqL/data
Installing MysqL system tables...2013-04-17 01:26:58 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-04-17 01:26:58 18715 [Note] InnoDB: The InnoDB memory heap is disabled
2013-04-17 01:26:58 18715 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation
2013-04-17 01:26:58 18715 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-04-17 01:26:58 18715 [Note] InnoDB: cpu does not support crc32 instructions
2013-04-17 01:26:58 18715 [Note] InnoDB: Initializing buffer pool,size = 128.0M
2013-04-17 01:26:58 18715 [Note] InnoDB: Completed initialization of buffer pool
2013-04-17 01:26:58 18715 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2013-04-17 01:26:59 18715 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2013-04-17 01:26:59 18715 [Note] InnoDB: Database physically writes the file full: wait...
2013-04-17 01:26:59 18715 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2013-04-17 01:26:59 18715 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2013-04-17 01:26:59 18715 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2013-04-17 01:26:59 18715 [Warning] InnoDB: New log files created,LSN=45781
2013-04-17 01:26:59 18715 [Note] InnoDB: Doublewrite buffer not found: creating new
2013-04-17 01:26:59 18715 [Note] InnoDB: Doublewrite buffer created
2013-04-17 01:26:59 18715 [Note] InnoDB: 128 rollback segment(s) are active.
2013-04-17 01:26:59 18715 [Warning] InnoDB: Creating foreign key constraint system tables.
2013-04-17 01:26:59 18715 [Note] InnoDB: Foreign key constraint system tables created
2013-04-17 01:26:59 18715 [Note] InnoDB: Creating tablespace and datafile system tables.
2013-04-17 01:26:59 18715 [Note] InnoDB: Tablespace and datafile system tables created.
2013-04-17 01:26:59 18715 [Note] InnoDB: Waiting for purge to start
2013-04-17 01:26:59 18715 [Note] InnoDB: 1.2.10 started; log sequence number 0
2013-04-17 01:26:59 18715 [Note] binlog end
2013-04-17 01:26:59 18715 [Note] InnoDB: FTS optimize thread exiting.
2013-04-17 01:26:59 18715 [Note] InnoDB: Starting shutdown...
2013-04-17 01:27:00 18715 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK
Filling help tables...2013-04-17 01:27:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-04-17 01:27:00 18738 [Note] InnoDB: The InnoDB memory heap is disabled
2013-04-17 01:27:00 18738 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation
2013-04-17 01:27:00 18738 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-04-17 01:27:00 18738 [Note] InnoDB: cpu does not support crc32 instructions
2013-04-17 01:27:00 18738 [Note] InnoDB: Initializing buffer pool,size = 128.0M
2013-04-17 01:27:00 18738 [Note] InnoDB: Completed initialization of buffer pool
2013-04-17 01:27:00 18738 [Note] InnoDB: Highest supported file format is Barracuda.
2013-04-17 01:27:00 18738 [Note] InnoDB: 128 rollback segment(s) are active.
2013-04-17 01:27:00 18738 [Note] InnoDB: Waiting for purge to start
2013-04-17 01:27:01 18738 [Note] InnoDB: 1.2.10 started; log sequence number 1625977
2013-04-17 01:27:01 18738 [Note] binlog end
2013-04-17 01:27:01 18738 [Note] InnoDB: FTS optimize thread exiting.
2013-04-17 01:27:01 18738 [Note] InnoDB: Starting shutdown...
2013-04-17 01:27:02 18738 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK
To start MysqLd at boot time you have to copy
support-files/MysqL.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MysqL root USER !
To do so,start the server,then issue the following commands:
/usr/local/MysqL/bin/MysqLadmin -u root password 'new-password'
/usr/local/MysqL/bin/MysqLadmin -u root -h MysqL5.6 password 'new-password'
Alternatively you can run:
/usr/local/MysqL/bin/MysqL_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MysqL daemon with:
cd . ; /usr/local/MysqL/bin/MysqLd_safe &
You can test the MysqL daemon with MysqL-test-run.pl
cd MysqL-test ; perl MysqL-test-run.pl
Please report any problems with the ./bin/MysqLbug script!
The latest information about MysqL is available on the web at
http://www.MysqL.com
Support MysqL by buying support/licenses at http://shop.MysqL.com
New default config file was created as /usr/local/MysqL/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings
WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MysqL server
If you do not want to use this,either remove it,or use the
--defaults-file argument to MysqLd_safe when starting the server
[root@MysqL5 scripts]#
[root@MysqL5 scripts]# cd /usr/local/MysqL/support-files/
[root@MysqL5 support-files]# cp MysqL.server /etc/rc.d/init.d/MysqL
[root@MysqL5 support-files]# cp my-default.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf'? y
[root@MysqL5 support-files]#
[root@MysqL5 support-files]# chkconfig -add MysqL
-add: unkNown option
[root@MysqL5 support-files]# chkconfig --add MysqL
[root@MysqL5 support-files]# chkconfig MysqL on
[root@MysqL5 support-files]# service MysqL start
Starting MysqL. [ OK ]
[root@MysqL5 support-files]#
[root@MysqL5 data]# MysqL -u MysqL -p -S /tmp/MysqL.sock
Enter password:
Welcome to the MysqL monitor. Commands end with ; or \g.
Your MysqL connection id is 1
Server version: 5.6.10 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
MysqL>
MysqL> status;
--------------
MysqL Ver 14.12 distrib 5.0.77,for redhat-linux-gnu (i686) using readline 5.1
Connection id: 1
Current database:
Current user: MysqL@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.6.10 Source distribution
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /tmp/MysqL.sock
Uptime: 3 min 38 sec
Threads: 1 Questions: 5 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables: 60 Queries per second avg: 0.022
--------------
MysqL>
linux mysql安装
想写点什么,怕自己哪天给忘了
写centos下的mysql安装吧
一、yum安装(路径都是rpm安装时默认的路径)
使用yum安装
安装mysql客户端:
yum install mysql
安装mysql 服务器端:
yum install mysql-server
yum install mysql-devel
有点windows下软件安装的感觉,比较简便。
自己习惯了以前服务器数据库存放路径为/data/mysql,套接字/tmp/mysql.sock
通过yum安装,数据库存放路径/var/lib/mysql,终究感觉不是那么习惯。
二、选择源码编译安装
1.下载mysql源码安装包
地址:http://www.mysql.com/downloads/mysql/5.5.html#downloads,我选择了mysql-5.5.28-linux2.6-x86_64.tar.gz
2.环境的配置
下载到服务器上后,会发现多了几个cmake文件,已经取代了之前的configure检查安装。所以环境中需要安装cmake包,当然gcc等关键安装包是必须的。
1.安装cmake
下载cmake#wget http://www.cmake.org/files/v2.8/cmake-2.8.3.tar.gz
安装gcc,gcc-c++
#yum -y install gcc
#yum -y install gcc-c++
配置编译cmake
#tar xvf cmake-2.8.3.tar.gz
#cd cmake-2.8.3
#./bootstrap
#gmake
#gmake install
2.安装mysql
1.下载mysql,所下载包为mysql-5.5.28-linux2.6-x86_64.tar.gz
2.添加必要的组和拥有者
#/usr/sbin/groupadd mysql
#/usr/sbin/useradd -g mysql mysql
#mkdir /data/mysql
#chown -R mysql:mysql /data/mysql
3.编译安装
# tar zxvf mysql-5.5.28-linux2.6-x86_64.tar.gz
# cd mysql-5.5.28-linux2.6-x86_64.tar.gz
#cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/data/mysql \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306
#make & make install
#chmod +w /usr/local/mysql
#chmod +w mysql:mysql /usr/local/mysql
#cd /usr/local/mysql
# cd support-files/
# cp my-large.cnf /etc/my.cnf
# cp mysql.server /etc/init.d/mysqld
4.以mysql用户账户的身份初始化DB
5.配置my.cnf
后续等等按照自己常用的操作来
安装方式分为rpm和源码编译安装两种,本文是采用mysql源码编译方式,编译器使用Cmake。软件需要mysql-5.5.29.tar.gz和cmake-2.8.10.2.tar.gz,请自行下载。
下载地址:
http://mysql.mirror.kangaroot.net/Downloads/
http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz
其中mysql使用最新的稳定版本,即最新试用版的上一个版本,且非rc或者alpha的版本,Cmake直接用的最新版。
1.上传mysql-5.5.29.tar.gz和cmake-2.8.10.2.tar.gz到/usr/local文件夹下。
2.CentOS安装g++和ncurses-devel
[root@localhost local]# yum install gcc-c++
[root@localhost local]# yum install ncurses-devel
3.cmake的安装
[root@localhost]# tar -zxv -f cmake-2.8.10.2.tar.gz // 解压压缩包
[root@localhost local]# cd cmake-2.8.10.2
[root@localhost cmake-2.8.10.2]# ./configure
[root@localhost cmake-2.8.10.2]# make
[root@localhost cmake-2.8.10.2]# make install
4.将cmake永久加入系统环境变量
用vi在文件/etc/profile文件中增加变量,使其永久有效,
[root@localhost local]# vi /etc/profile
在文件末尾追加以下两行代码:
PATH=/usr/local/cmake-2.8.10.2/bin:$PATH
export PATH
执行以下代码使刚才的修改生效:
[root@localhost local]# source /etc/profile
用 export 命令查看PATH值
[root@localhost local]# echo $PATH
5.创建mysql的安装目录及数据库存放目录
[root@localhost]# mkdir -p /usr/local/mysql //安装mysql
[root@localhost]# mkdir -p /usr/local/mysql/data //存放数据库
6.创建mysql用户及用户组
[root@localhost] groupadd mysql
[root@localhost] useradd -r -g mysql mysql
7.编译安装mysql
[root@localhost local]# tar -zxv -f mysql-5.5.29.tar.gz //解压
[root@localhost local]# cd mysql-5.5.29
[root@localhost mysql-5.5.29]#
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306
[root@localhost mysql-5.5.29]# make
[root@localhost mysql-5.5.29]# make install
8.检验是否安装成功
[root@localhost mysql-5.5.29]# cd /usr/local/mysql/
[root@localhost mysql]# ls
bin COPYING data docs include INSTALL-BINARY lib man mysql-test README scripts share sql-bench support-files
有bin等以上文件的话,恭喜你已经成功安装了mysql。
配置mysql
9.设置mysql目录权限
[root@localhost mysql]# cd /usr/local/mysql //把当前目录中所有文件的所有者设为root,所属组为mysql
[root@localhost mysql]# chown -R root:mysql .
[root@localhost mysql]# chown -R mysql:mysql data
10.将mysql的启动服务添加到系统服务中
[root@localhost mysql]# cp support-files/my-medium.cnf /etc/my.cnf
cp:是否覆盖"/etc/my.cnf"? y
11.创建系统数据库的表
[root@localhost mysql]# cd /usr/local/mysql
[root@localhost mysql]# scripts/mysql_install_db --user=mysql
12.设置环境变量
[root@localhost ~]# vi /root/.bash_profile
在修改PATH=$PATH:$HOME/bin为:
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib
[root@localhost ~]# source /root/.bash_profile //使刚才的修改生效
13.手动启动mysql
[root@localhost ~]# cd /usr/local/mysql
[root@localhost mysql]# ./bin/mysqld_safe --user=mysql & //启动MySQL,但不能停止
mysqladmin -u root -p shutdown //此时root还没密码,所以为空值,提示输入密码时,直接回车即可。
14.将mysql的启动服务添加到系统服务中
[root@localhost mysql]# cp support-files/mysql.server /etc/init.d/mysql
15.启动mysql
[root@localhost mysql]# service mysql start
Starting MySQL... ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).
启动失败:
我这里是权限问题,先改变权限
[root@localhost mysql]# chown -R mysql:mysql /usr/local/mysql
接着启动服务器
[root@localhost mysql]# /etc/init.d/mysql start
16.修改MySQL的root用户的密码以及打开远程连接
[root@localhost mysql]# mysql -u root mysql
mysql> use mysql;
mysql> desc user;
mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root"; //为root添加远程连接的能力
mysql> update user set Password = password(''123456'') where User=''root''; //设置root用户密码
mysql> select Host,User,Password from user where User=''root'';
mysql> flush privileges;
mysql> exit
17.重新登录
[root@localhost mysql]# mysql -u root -p
Enter password:123456
若还不能进行远程连接,关闭防火墙
[root@localhost]# /etc/rc.d/init.d/iptables stop
linux – 为现有的MySQL安装配置PHP
Apache,PHP和MysqL.他安装了PHP,但没有配置MysqL扩展(我假设因为服务器只托管一个基于rails的网站).
所以我需要重新配置PHP以使用MysqL扩展.这是当前的PHP配置(来自PHPhinfo();):
'./configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '-- target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '-- bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '-- includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '-- localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '-- infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config- file-path=/etc' '--with-config-file-scan-dir=/etc/PHP.d' '--disable-debug' '--with-pic' '-- disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '-- with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '-- with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with- png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '-- with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable- trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '-- with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '-- enable-dbx' '--enable-dio' '--with-mime-magic=/usr/share/file/magic.mime' '--without- sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-system-tzdata' '--with- apxs2=/usr/sbin/apxs' '--without-MysqL' '--without-gd' '--without-odbc' '--disable-dom' '-- disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable- xmlwriter'
你可以看到他在那里有–without-MysqL.
当你配置PHP使用–with-MysqL时,你必须指定MysqL的路径吗?还是MysqL源码?或类似的东西?像这样的东西:
--with-MysqL=/usr/local/MysqL
这个现有设置的问题是MysqL已经安装,除了我不知道它安装在哪里…我知道有/etc/init.d/MysqLd.我还找到了以下目录:
/usr/lib中/ MysqL的/
在/ usr /包括/ MysqL的/
的/ usr /共享/ MysqL的/
任何人都能指出我在正确的方向吗?我只是不知道在PHP配置中使用什么目录–with-MysqL.
UPDATE
好的,所以我重新配置并重新安装并安装了PHP.现在,当我重新启动Apache时,我得到以下内容:
[warn] module PHP5_module is already loaded,skipping
这是因为PHP之前已经在服务器上运行了吗?我查看了httpd.conf,它只有一个PHP5_module实例加载…
但是,现在查看PHPinfo();它显示了我刚刚配置/安装的新更新版本中使用的PHP.
另外,PHPinfo();将MysqL显示为正在使用,但是当我尝试安装say,wordpress(使用MysqL)时,wordpress会出现此错误:
Your PHP installation appears to be missing the MysqL extension which is required by wordpress.
我现在应该在哪里看?
更新#2
目前还没有解决方案.我已经完成了PHP的配置,包括MysqL和PHPinfo(); (是的,我正在使用file.PHP查看此内容)显示–with-MysqL = shared,/ usr(根据下面的其他用户建议). PHP仍然没有将MysqL扩展识别为在配置中.
我只是不明白你应该在-with-MysqL =的末尾放置什么路径?我找到了以下目录:
/usr/bin/ contains: MysqL (executable?) /usr/lib/MysqL/ contains: libdbug.a libmyisammrg.a libMysqLclient_r.so libMysqLclient.so libmystrings.a MysqLbug libheap.a libMysqLclient.a libMysqLclient_r.so.15 libMysqLclient.so.15 libmysys.a MysqL_config libmyisam.a libMysqLclient_r.a libMysqLclient_r.so.15.0.0 libMysqLclient.so.15.0.0 libvio.a /usr/include/MysqL/ contains: chardefs.h keymaps.h my_config.h my_global.h MysqL_com.h MysqL_time.h readline.h sql_common.h tilde.h decimal.h m_ctype.h my_config_i386.h my_list.h MysqLd_ername.h MysqL_version.h rlmbutil.h sql_state.h typelib.h errmsg.h m_string.h my_dbug.h my_net.h MysqLd_error.h my_sys.h rlprivate.h sslopt-case.h xmalloc.h history.h my_alloc.h my_dir.h my_no_pthread.h MysqL_embed.h my_xml.h rlshell.h sslopt-longopts.h keycache.h my_attribute.h my_getopt.h my_pthread.h MysqL.h raid.h rltypedefs.h sslopt-vars.h /usr/share/MysqL/ contains: charsets english french italian my-innodb-heavy-4G.cnf MysqL_fix_privilege_tables.sql norwegian romanian spanish czech errmsg.txt german japanese my-large.cnf MysqL_system_tables_data.sql norwegian-ny russian swedish danish estonian greek korean my-medium.cnf MysqL_system_tables.sql polish serbian ukrainian dutch fill_help_tables.sql hungarian my-huge.cnf my-small.cnf MysqL_test_data_timezone.sql portuguese slovak
这有什么帮助吗?
更新3
是的我正在使用虚拟主机.这是我的conf文件:
Listen 80 NameVirtualHost *:80 <VirtualHost *:80> ServerName thedomain.com ServerAlias www.thedomain.com DocumentRoot /u1/thedomain.com/public RailsEnv production </VirtualHost> <VirtualHost *:80> ServerName subdomain.thedomain.com DocumentRoot /u1/subdomain.thedomain.com/public </VirtualHost>
我正在尝试在子域上设置基本的wordpress安装.我仍然收到此错误:
Your PHP installation appears to be missing the MysqL extension which is required by wordpress.
解决了
我刚刚在PHP配置中添加了–with-MysqL(没有路径)并重新安装它,PHP显然已经从MysqL自己发现了它所需要的东西.感谢大家的见解.
解决方法
linux 上安装多个不同版本的mysql 踩的坑
最近由于业务需要,考虑使用json
类型,据了解 mysql
在版本5.7中可以支持 json
类型的数据支持,但同时目前开发环境中使用的是 mysql
5.6版本,上面还有很多项目的数据库在上面,同时也没有多余的服务器可供使用,故不能直接卸载将 mysql
直接升级版本。 从而想到在同一台机器上安装多个版本的 mysql
来解决问题。
上面说到之前环境已经装有mysql
5.6版本,基本配置如下:
datadir=/home/mysql/data
basedir=/usr/local/mysql
同时配置文件 my.cnf
放在在 /etc/
目录下。 此版本是通过 yum
的方式来下载安装的,故5.7的版本不能再使用这种方式安装,以免数据被覆盖。
我的系统版本是centos 64位,故在官网下载 5.7 64版本的安装包。(https://downloads.mysql.com/archives/get/file/mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz) 具体操作如下:
mkdir /usr/local/app
cd /usr/local/app
wget -o https://downloads.mysql.com/archives/get/file/mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz
tar -xzf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.7.24-linux-glibc2.12-x86_64 mysql-5.7.24
mv mysql-5.7.24 ../
cd ../mysql-5.7.24
此时已将 mysql
5.7 解压出来。这个版本的 mysql
已经不包含模板配置文件。此时初始化数据库(先授权,由于之前已经创建了mysql:mysql的用户组及用户了,但还没有5.7版本目录和数据的权限):
mkdir /home/mysql-5.7.24/data
chown mysql:mysql -R /home/mysql-5.7.24/data /usr/local/mysql-5.7.24
./bin/mysqld --initialize --user=mysql --datadir=/home/mysql-5.7.24/data --basedir=/usr/local/mysql-5.7.24
此时会生成默认的 root
密码,记下来。 然后再使用 mysqld_multi
来管理多实例。原本我是想直接使用support-files
目录下mysql_server
来启动的,但是发现个问题,就是该脚本总是使用 /etc/my.cnf
作为配置文件来启动的,于是我查了下资料,发现mysql
读写配置顺序如下:
/etc/my.cnf > /etc/mysql/my.cnf > /usr/etc/my.cnf > ~/.my.cnf
由于该配置文件已被 5.6 版本的 mysql
使用,故寻找其他方法。 ###方法一 使用 mysqld_multi
来管理。 修改 /etc/my.cnf
:
#[client]
#port = 3306
#socket = /usr/local/mysql/mysql.sock
[mysqld_multi]
mysqld = /usr/local/mysql-5.7.24/bin/mysqld_safe
log = /var/log/mysqld_multi.log
[mysqld3306]
user=mysql
server_id=206
port = 3306
basedir = /usr/local/mysql
datadir = /home/mysql/data
tmpdir = /home/mysql/temp
socket = /usr/local/mysql/mysql.sock
log-error = /home/mysql/logs/mysql_error.log
pid-file = /home/mysql/mysql.pid
slow-query-log-file = /home/mysql/logs/mysql-slow.log
[mysqld3307]
user=mysql
server_id=207
port = 3307
basedir = /usr/local/mysql-5.7.24
datadir = /home/mysql-5.7.24/data
tmpdir = /home/mysql-5.7.24/temp
socket = /usr/local/mysql-5.7.24/mysql.sock
log-error = /home/mysql-5.7.24/logs/mysql_error.log
pid-file = /home/mysql-5.7.24/mysql.pid
slow-query-log-file = /home/mysql-5.7.24/logs/mysql-slow.log
[mysqld]
#server_id=206
#binlog-do-db=testdb
binlog-ignore-db=mysql
log-bin=edu-mysql-slave1-bin
binlog_cache_size = 1M
binlog_format=mixed
expire_logs_days=7
slave_skip_errors=1062
relay_log=edu-mysql-relay-bin
log_slave_updates=1
read_only=0
character-set-server = utf8
collation-server = utf8_general_ci
skip-external-locking
skip-name-resolve
#user = mysql
#port = 3306
#basedir = /usr/local/mysql
#datadir = /home/mysql/data
#tmpdir = /home/mysql/temp
# server_id = .....
#socket = /usr/local/mysql/mysql.sock
#log-error = /home/mysql/logs/mysql_error.log
#pid-file = /home/mysql/mysql.pid
open_files_limit = 10240
back_log = 600
max_connections=500
max_connect_errors = 6000
wait_timeout=605800
#open_tables = 600
#table_cache = 650
#opened_tables = 630
max_allowed_packet = 32M
sort_buffer_size = 4M
join_buffer_size = 4M
thread_cache_size = 300
query_cache_type = 1
query_cache_size = 256M
query_cache_limit = 2M
query_cache_min_res_unit = 16k
tmp_table_size = 256M
max_heap_table_size = 256M
key_buffer_size = 256M
read_buffer_size = 1M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
lower_case_table_names=1
default-storage-engine = INNODB
innodb_buffer_pool_size = 2G
innodb_log_buffer_size = 32M
innodb_log_file_size = 128M
innodb_flush_method = O_DIRECT
#####################
#thread_concurrency = 32
long_query_time= 2
slow-query-log = on
#slow-query-log-file = /home/mysql/logs/mysql-slow.log
[mysqld-5.7]
innodb_buffer_pool_dump_pct = 40
innodb_page_cleaners = 4
innodb_undo_log_truncate = 1
innodb_max_undo_log_size = 1G
innodb_purge_rseg_truncate_frequency = 128
binlog_gtid_simple_recovery=1
log_timestamps=system
transaction_write_set_extraction=MURMUR32
show_compatibility_56=on
[mysqldump]
quick
max_allowed_packet = 32M
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
上面多余的配置根据需求可以去掉,保留关键的配置即可,主要是端口,pid,和文件路径这些要不一样。 修改完成后,可以使用 support_files
目录下的 mysqld_multi.server
来管理多个版本实例了。 ./mysqld_multi.server
有 start
,stop
,report
几个操作,顾名思义,使用就好了,report
就是类似 status
的意思。
./mysqld_multi.server report
发现
MySQL server from group: mysqld3306 is running
MySQL server from group: mysqld3307 is not running
然后启动3307即可, ./mysqld_multi.server start 3307
MySQL server from group: mysqld3306 is running
MySQL server from group: mysqld3307 is running
不指定某个具体的实例就是启动或者关闭所有的。
这样就搞定了,但在终端使用客户端的时候要注意要具体指定某一个sock文件和端口:
mysql -S /usr/local/mysql-5.7.24/mysql.sock -P 3307 -u root -p
最后,可以将 mysqld_multi
作为系统服务:
cp /usr/local/mysql-5.7.24/support-files/mysqld_multi.server /etc/rc.d/init.d/mysqld_multi
chkconfig --add /mysqld_multi
就可以直接使用了:
mysqld_multi report
###方法二 使用 bin/mysqld_safe
指定配置文件来启动:
cp /etc/my.cnf ./
##改改其中的一些配置(端口,pid,和文件路径)
./bin/mysqld_safe –defaults-file=/usr/local/mysql-5.7.24/my.cnf –basedir=/usr/local/mysql-5.7.24 –datadir=/home/mysql-5.7.24/data &
文章有些杂乱,有时间再优化。
我们今天的关于如何在官网上下载Linux版本的MySQL安装包的分享已经告一段落,感谢您的关注,如果您想了解更多关于linux mysql5.6版本的安装配置过程、linux mysql安装、linux – 为现有的MySQL安装配置PHP、linux 上安装多个不同版本的mysql 踩的坑的相关信息,请在本站查询。
本文标签: