Linux下安装MySQL 5.6.4
mysql 5.6安装

1.1.1安装MySQL5.6文件下载:10.45.15.23 tnms/Tnms@2018/home/tnms/mysql-5.6.12-linux-glibc2.5-x86_64.tar --安装包/home/tnms/f --配置文件a) 准备工作创建mysql用户[root@centos /]# useradd -s /sbin/nologin -M mysql文件上传opt路径下解压文件[root@centos opt]# gunzip mysql-5.6.37-linux-glibc2.12-x86_64.tar.gz [root@centos opt]# tar -xvf mysql-5.6.37-linux-glibc2.12-x86_64.tar重命名为mysql[root@centos opt]# mv mysql-5.6.37-linux-glibc2.12-x86_64 mysql b) 文件配置f文件复制[root@centos opt]# cp /opt/mysql/support-files/f /etc/f •编辑/etc/f#二进制安装,默认配置文件在/etc/f[root@centos opt]# vi /etc/f清空f里面内容,将以下内容粘贴进去[client]port = 3306socket = /opt/mysql/mysql.sock[mysql]#这个配置段设置启动MySQL服务的条件;在这种情况下,no-auto-rehash确保这个服务启动得比较快。
no-auto-rehashport=3306default-character-set=utf8[mysqld]character-set-server = utf8user = mysqlport = 3306socket = /opt/mysql/mysql.sockbasedir = /opt/mysqldatadir = /opt/mysql/dataopen_files_limit = 10240server_id = 10back_log = 600#在MYSQL暂时停止响应新请求之前,短时间内的多少个请求可以被存在堆栈中。
linuxCentOS6.5yum安装mysql5.6

linuxCentOS6.5yum安装mysql5.6本⽂为⼤家分享了linux yum安装mysql5.6简单过程,供⼤家参考,具体内容如下1.新开的云服务器,需要检测系统是否⾃带安装mysql# yum list installed | grep mysql2.如果发现有系统⾃带mysql,果断这么⼲# yum -y remove mysql-libs.x86_643.随便在你存放⽂件的⽬录下执⾏,这⾥解释⼀下,由于这个mysql的yum源服务器在国外,所以下载速度会⽐较慢,还好mysql5.6只有79M⼤,⽽mysql5.7就有182M了,所以这是我不想安装mysql5.7的原因# wget /mysql-community-release-el6-5.noarch.rpm4.接着执⾏这句,解释⼀下,这个rpm还不是mysql的安装⽂件,只是两个yum源⽂件,执⾏后,在/etc/yum.repos.d/ 这个⽬录下多出mysql-community-source.repo和mysql-community.repo# rpm -ivh mysql-community-release-el6-5.noarch.rpm5.这个时候,可以⽤yum repolist mysql这个命令查看⼀下是否已经有mysql可安装⽂件#yum repolist all | grep mysql6.安装mysql 服务器命令(⼀路yes):# yum install mysql-community-server7.安装成功后# service mysqld start8.由于mysql刚刚安装完的时候,mysql的root⽤户的密码默认是空的,所以我们需要及时⽤mysql的root⽤户登录(第⼀次回车键,不⽤输⼊密码),并修改密码# mysql -u root# use mysql;# update user set password=PASSWORD("这⾥输⼊root⽤户密码") where User='root';# flush privileges;9.查看mysql是否⾃启动,并且设置开启⾃启动命令# chkconfig --list | grep mysqld# chkconfig mysqld on10.mysql安全设置(系统会⼀路问你⼏个问题,看不懂复制之后翻译,基本上⼀路yes):# mysql_secure_installation以上就是本⽂的全部内容,希望对⼤家的学习有所帮助,也希望⼤家多多⽀持。
5.6版本MySQL的下载、安装及配置过程

下载及安装MySQL自MySQL版本升级到5.6以后,其安装及配置过程和原来版本发生了很大的变化,下面详细介绍5.6版本MySQL的下载、安装及配置过程。
图1.1 MySQL5.6目前针对不同用户,MySQL提供了2个不同的版本:MySQL Community Server:社区版,该版本完全免费,但是官方不提供技术支持。
MySQL Enterprise Server:企业版,它能够高性价比的为企业提供数据仓库应用,支持ACID事物处理,提供完整的提交、回滚、崩溃恢复和行级锁定功能。
但是该版本需付费使用,官方提供电话及文档等技术支持。
目前最新的MySQL版本为MySQL 5.6,可以在官方网站(/downloads/)上面下载该软件。
在下图1.2所示的MySQL官网上单击右下角的“MySQL Installer 5.6”超链接,然后按照提示一步步操作就可以将MySQL软件下载到本地计算机中了。
注意这里我们选择的是数据库版本是“Windows (x86, 32-bit), MSI Installer”,如下图1.3所示。
图1.2 MySQL官方网站图1.3 选择MySQL版本MySQL下载完成后,找到下载到本地的文件,按照下面所示的步骤双击进行安装:步骤1:双击MySQL安装程序(mysql-installer-community-5.6.10.1),会弹出如下图1.4所示的欢迎窗口。
图1.4 MySQL欢迎界面步骤2:单击图1.4中的“Install MySQL Products”文字,会弹出的用户许可证协议窗口,如下图1.5所示。
图1.5 用户许可证协议窗口步骤3:选中“I accept the license terms”的前面的选择框,然后点击【Next】按钮,会进入查找最新版本界面,效果如下图1.6所示:图1.6 查找最新版本窗口步骤4:单击【Execute】按钮,会进入安装类型设置界面,效果如下图1.7所示。
如何在Linux系统中安装数据库

如何在Linux系统中安装数据库在Linux系统中,安装数据库是一项重要且常见的任务。
数据库是用于存储、管理和访问数据的软件系统,它在各种应用领域中都扮演着关键角色。
本文将介绍如何在Linux系统中安装数据库,并提供适当的步骤和指导。
一、选择适合的数据库在开始安装之前,我们需要选择适合我们需求的数据库。
常见的Linux数据库包括MySQL、PostgreSQL和MongoDB等。
根据具体情况,选择最适合您项目需求的数据库软件。
二、安装依赖在安装数据库之前,我们需要确保系统中已经安装了一些必要的依赖项。
这些依赖项通常包括C/C++编译器、开发工具包以及其他必要的库文件。
您可以通过系统包管理器来安装这些依赖项。
以下是一些常见的依赖项的安装命令示例:对于Debian/Ubuntu系统:```sudo apt-get updatesudo apt-get install build-essential```对于CentOS/Fedora系统:sudo yum updatesudo yum groupinstall "Development Tools"```三、下载和安装数据库软件一旦我们安装好了依赖项,我们可以开始下载和安装数据库软件。
在此我们以MySQL为例,介绍如何在Linux系统中安装。
1. 首先,我们需要访问MySQL的官方网站,下载适用于Linux系统的MySQL安装包。
您可以在MySQL官方网站的下载页面找到适合您系统的安装包。
2. 下载完成后,将安装包移动到指定目录。
我们可以使用以下命令来解压和移动文件:```tar -zxvf mysql-VERSION.tar.gzsudo mv mysql-VERSION /usr/local/mysql```请注意将"VERSION"替换为您下载的文件的实际版本号。
3. 接下来,我们需要创建MySQL的相关用户和组,以及设置权限。
Linux下安装及配置MySQL详细过程(自己实践总结)

Red Hat Linux下安装及配置MySQL的详细教程大致思路如下:1.下载所需的安装包(Linux下用wget下载,笔者在window下下载的,用XSHELL命令RZ上传到Linux中)2.安装MySQL3.创建新用户并授权安装及配置的详细步骤如下:第一步:检测系统版本信息Linux命令: cat /proc/versionLinux version 2.6.32-220.el6.i686 (mockbuild@) (gcc version 4.4.5 20110214 (Red Hat 4.4.5-6) (GCC) ) #1 SMP Wed Nov 9 08:02:18 EST 2011当前Linux版本为RedHat 4.4.5-6(为内核版本)Linux命令:cat /etc/issueRed Hat Enterprise Linux Server release 6.2 (Santiago)Kernel \r on an \mLinux命令: uname -a 或getconf LONG_BITLinux localhost.localdomain 2.6.32-220.el6.i686 #1 SMP Wed Nov 9 08:02:18 EST 2011 i686 i686 i386 GNU/Linux可以看到当前系统为32位的(而64位系统会有x64字符串显示出来)。
第二步:根据Linux系统的环境,下载mysql Community Server官方下载地址: /downloads/mysql/可以选择【Linux-Generic】,下载对应的RMP包.由于当前系统为redhat(64位),所以直接选择Oracle &Red Hat Linux 4 & 5。
Mysql安装包有很多,作用也不同,大多数情况下只需要安装MySQL-Server和MySQL-Client,其它包根据需要安装.32位的下载下面的两个安装包文件:MySQL-server-5.6.11-2.linux_glibc2.5.i386.rpmMySQL-client-5.6.11-2.linux_glibc2.5.i386.rpm(而64位下载下面两个安装包文件:MySQL-server-5.6.11-2.linux_glibc2.5.x86_64.rpmMySQL-client-5.6.11-2.linux_glibc2.5.x86_64.rpm)第三步: 安装MySQL安装顺序: 先安装服务器,然后再安装客户端。
MySql5.6.3664位绿色版安装图文教程

<span style="font-size:14px;"># For advice on how to change settings please see # /doc/refman/5.6/en/server-configuration-defaults.html # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the # *** default location during install, and will be replaced if you # *** upgrade to a newer version of MySQL. [mysqld] # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. basedir ="D:\Program Files\mysql-5.6.36-winx64" datadir ="D:\Program Files\mysql-5.6.36-winx64\data" # port = ..... # server_id = ..... # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES #服务端的编码方式 character-set-server=utf8 [client] #客户端编码方式,最好和服务端保存一致 loose-default-character-set = utf8 [WinMySQLadmin] Server = "D:\Program Files\mysql-5.6.36-winx64\bin\mysqld.exe"
CentOS 6.0安装MySQL 5.6及配置

CentOS 6.0安装MySQL 5.6及配置从今年3月份开始mysql官网开始发布相关的5.6系列的各个版本,对于mysql5.6系列的版本对一起的版本进行了全局性的细节性加强;个人感觉,以下是在虚拟机中配置的mysql5.6.10源码安装的过程分享记录下:一、必要软件包安装:[root@mysql5~]#yum -y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurse s-devel libmcrypt* libtool-ltdl-devel* make cmake二、编译安装:[root@mysql5 ~]# groupadd mysql[root@mysql5 ~]# useradd -r -g mysql mysql[root@mysql5 ~]# lsanaconda-ks.cfg install.log install.log.syslog mysql-5.6.10.tar.gz[root@mysql5 ~]# cd /usr/local/[root@mysql5 local]# lsbin etc games include lib libexec sbin share src[root@mysql5 local]# cp /root/mysql-5.6.10.tar.gz /usr/local/[root@mysql5 local]# lltotal 34468drwxr-xr-x 2 root root 4096 Jan 27 2010 bindrwxr-xr-x 2 root root 4096 Jan 27 2010 etcdrwxr-xr-x 2 root root 4096 Jan 27 2010 gamesdrwxr-xr-x 2 root root 4096 Jan 27 2010 includedrwxr-xr-x 2 root root 4096 Jan 27 2010 libdrwxr-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.gzdrwxr-xr-x 2 root root 4096 Jan 27 2010 sbindrwxr-xr-x 4 root root 4096 Apr 17 00:32 sharedrwxr-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[root@mysql5 local]# cmake . ###编译报如下错误暂不管[ 63%] Building CXX object sql/CMakeFiles/sql.dir/sql_.o/root/mysql-5.6.13/sql/sql_: In member function ‘void Optimize_table_order::best_access_path(JOIN_TAB*, table_map, uint, bool, double, POSITION*, POSITION*)’:/root/mysql-5.6.13/sql/sql_:431: warning: ‘loose_scan_opt.Loose_scan_opt::best_loose_scan_start_key’may be used uninitialized in this function/root/mysql-5.6.13/sql/sql_:431: warning: ‘loose_scan_opt.Loose_scan_opt::best_max_loose_keypart’may be used uninitialized in this function/root/mysql-5.6.13/sql/sql_:431: warning: ‘loose_scan_opt.Loose_scan_opt::best_loose_scan_records’may be used uninitialized in this function/root/mysql-5.6.13/sql/sql_:431: warning: ‘loose_scan_opt.Loose_scan_opt::best_loose_scan_key’may be used uninitialized in this function/root/mysql-5.6.13/sql/sql_:431: warning: ‘loose_scan_opt.Loose_scan_opt::quick_max_loose_keypart’may be used uninitialized in this function[root@mysql5 local]# make && make install三、配置MySQL[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/mysql --datadir=/usr/local/mysql/dataInstalling 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 disabled2013-04-17 01:26:58 18715 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation2013-04-17 01:26:58 18715 [Note] InnoDB: Compressed tables use zlib 1.2.32013-04-17 01:26:58 18715 [Note] InnoDB: CPU does not support crc32 instructions2013-04-17 01:26:58 18715 [Note] InnoDB: Initializing buffer pool, size = 128.0M2013-04-17 01:26:58 18715 [Note] InnoDB: Completed initialization of buffer pool2013-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 MB2013-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 MB2013-04-17 01:26:59 18715 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB2013-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=457812013-04-17 01:26:59 18715 [Note] InnoDB: Doublewrite buffer not found: creating new2013-04-17 01:26:59 18715 [Note] InnoDB: Doublewrite buffer created2013-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 created2013-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 start2013-04-17 01:26:59 18715 [Note] InnoDB: 1.2.10 started; log sequence number 02013-04-17 01:26:59 18715 [Note] Binlog end2013-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 OKFilling 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 disabled2013-04-17 01:27:00 18738 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation2013-04-17 01:27:00 18738 [Note] InnoDB: Compressed tables use zlib 1.2.32013-04-17 01:27:00 18738 [Note] InnoDB: CPU does not support crc32 instructions2013-04-17 01:27:00 18738 [Note] InnoDB: Initializing buffer pool, size = 128.0M2013-04-17 01:27:00 18738 [Note] InnoDB: Completed initialization of buffer pool2013-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 start2013-04-17 01:27:01 18738 [Note] InnoDB: 1.2.10 started; log sequence number 16259772013-04-17 01:27:01 18738 [Note] Binlog end2013-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 OKTo start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your systemPLEASE 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_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly 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.plcd mysql-test ; perl mysql-test-run.plPlease report any problems with the ./bin/mysqlbug script!The latest information about MySQL is available on the web at Support MySQL by buying support/licenses at New default config file was created as /usr/local/mysql/f and will be used by default by the server when you start it.You may edit this file to change server settingsWARNING: Default config file /etc/f exists on the systemThis file will be read by default by the MySQL serverIf 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 cp: overwrite `/etc/rc.d/init.d/mysql'? y[root@mysql5 support-files]# cp f /etc/fcp: overwrite `/etc/f'? 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 startStarting MySQL. [ OK ] [root@mysql5 support-files]#[root@mysql5 data]# mysql -u mysql -p -S /tmp/mysql.sockEnter password:Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.6.10 Source distributionType '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.1Connection id: 1Current database:Current user: mysql@localhostSSL: Not in useCurrent pager: stdoutUsing outfile: ''Using delimiter: ;Server version: 5.6.10 Source distributionProtocol version: 10Connection: Localhost via UNIX socketServer characterset: latin1Db characterset: latin1Client characterset: latin1Conn. characterset: latin1UNIX socket: /tmp/mysql.sockUptime: 3 min 38 secThreads: 1 Questions: 5 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables: 60 Queries per second avg: 0.022--------------mysql>四、远程登录及常用命令1、mysql服务的启动和停止net stop mysqlnet start mysql2、本地登陆mysql及远程登录语法如下:mysql -u用户名-p用户密码键入命令mysql –uroot -p,回车后提示你输入密码,输入12345,然后回车即可进入到mysql 中了,mysql的提示符是:mysql>注意,如果是连接到另外的机器上,则需要加入一个参数-h机器IP但被远程登录的mysql服务器需增加登录账号,方法如下:mysql>GRANT ALL PRIVILEGES ON*.* TO USER1@’%’ IDENTIFIED BY ’password’mysql>FLUSH PRIVILEGES;3、增加新用户格式:grant 权限on 数据库.* to 用户名@登录主机identified by "密码"如,增加一个用户user1密码为password1,让其可以在本机上登录,并对所有数据库有查询、插入、修改、删除的权限。
Linux离线安装mysql5.6详细步骤

Linux离线安装mysql5.6详细步骤⼀、安装MySQL1、下载安装包 mysql-5.6.40-linux-glibc2.12-x86_64.tar.gz2、卸载系统⾃带的Mariadbrpm -qa|grep mariadb //查询已安装的mariadbrpm -e --nodeps ⽂件名//卸载,⽂件名为使⽤rpm -qa|grep mariadb 命令查出的所有⽂件3、删除etc⽬录下的f⽂件(如果没有就直接新建)rm /etc/f4、执⾏以下命令来创建mysql⽤户组groupadd mysql5、执⾏以下命令来创建⼀个⽤户名为mysql的⽤户并加⼊mysql⽤户组useradd -g mysql mysql6、将下载的⼆进制压缩包放到/usr/local/⽬录下。
7、解压安装包tar -zxvf mysql-5.6.40-linux-glibc2.12-x86_64.tar.gz8、将解压好的⽂件夹重命名为mysqlmv mysql-5.6.40-linux-glibc2.12-x86_64.tar.gz mysql9、在etc下新建配置⽂件f,并在该⽂件内添加以下代码:[mysql]# 设置mysql客户端默认字符集default-character-set=utf8socket=/var/lib/mysql/mysql.sock[mysqld]skip-name-resolve#设置3306端⼝port=3306socket=/var/lib/mysql/mysql.sock# 设置mysql的安装⽬录basedir=/usr/local/mysql# 设置mysql数据库的数据的存放⽬录datadir=/usr/local/mysql/data# 允许最⼤连接数max_connections=200# 服务端使⽤的字符集默认为8⽐特编码的latin1字符集character-set-server=utf8# 创建新表时将使⽤的默认存储引擎default-storage-engine=INNODBlower_case_table_names=1max_allowed_packet=16M10、创建步骤9中⽤到的⽬录并将其⽤户设置为mysqlmkdir /var/lib/mysqlmkdir /var/lib/mysql/mysqlchown -R mysql:mysql /var/lib/mysqlchown -R mysql:mysql /var/lib/mysql/mysql11、进⼊安装mysql软件⽬录cd /usr/local/mysqlchown -R mysql:mysql ./ #修改当前⽬录拥有者为mysql⽤户./scripts/mysql_install_db --user=mysql #安装数据库chown -R mysql:mysql data #修改当前data⽬录拥有者为mysql⽤户到此数据库安装完成!⼆、配置MySQL1、授予f的最⼤权限。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Linux下安装MySQL 5.6.4
从mysql-5.5起,mysql源码安装开始使用cmake了,因此当我们配置安装目录./configure --perfix=/.....的时候,和以前将会有些区别。
(1)安装前,下载必要软件:
mysql-5.6.4-m7-tar.zip
cmake-2.8.10.2.tar.gz
(2)下述步骤中的红色字体的文件路径,根据实际情况进行替换,请注意路径的一致性。
(3)以下安装步骤在root用户下安装测试通过。
1.创建mysql用户
# useradd-d /home/mysql-c “Oracle MySQL”-m mysql
2.解压缩MySQL安装文件mysql-5.6.4-m7-tar.zip
# unzip mysql-5.6.4-m7-tar.zip
#tar -zxvf mysql-5.6.4-m7-tar.gz
3.安装cmake
接下来我们就要配置安装目录进行具体的安装了,这里需要注意的是利用cmake时需要安装cmake的应用程序。
(1)解压缩cmake安装文件
# tar -zxvf cmake-2.8.10.2.tar.gz
(2)进入
# cd cmake-2.8.10.2
(3)建立目录:
# mkdir/home/mysql/cmake
(4)配置安装目录
# ./configure --prefix=/home/mysql/cmake
(5)编译
# make
(6)安装
# make install
(7)更新环境变量
# export PATH=/home/mysql/cmake/bin:$PATH
4.配置mysql的安装目录
(1)进入解压缩后的mysql目录mysql-5.6.4-m7
# cd/home/mysql/mysql-5.6.4-m7
(2)根据转换关系执行cmake
#cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
5.安装mysql
# make install
执行完后会看到安装成功的提示
6.安装默认的数据库
#cd/usr/local/mysql/scripts/
#sudo ./mysql_install_db
--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data/ --user=mysql
7.将mysql的配置文件和服务文件复制到系统配置路径下面
#cd/usr/local/mysql/support-files
# cp f /etc/f
#cpmysql.server /etc/init.d/mysqld
8.修改启动服务
# servicemysqld start
或者:
# /etc/init.d/mysqld start
添加到开机自启动
# chkconfig --add mysqld
9.增加mysql的root用户的密码(如:123456)
#mysqladmin -u root password '123456'
10.在进程中查看启动的情况
#ps -ef | grepmysqld
从里面可以看出mysqld的启动用户,还可以看到安装目录以及端口号等。
11.连接到数据库
# su-mysql
$mysql-uroot-p123456。