5.6版本MySQL的下载、安装及配置过程

合集下载

MySQL5.6安装步骤图文详解

MySQL5.6安装步骤图文详解

MySQL5.6安装步骤图⽂详解MySQL是⼀个开放源码的⼩型关系型数据库管理系统,⽬前MySQL被⼴泛地应⽤在Internet上的中⼩型⽹站中。

由于其体积⼩、速度快、总体拥有成本低,尤其是开放源码这⼀特点,许多中⼩型⽹站为了降低⽹站总体拥有成本⽽选择了MySQL作为⽹站数据库。

但对于刚接触MySQL数据库服务器的朋友来说,可能会感到陌⽣,不知所错,所以下⾯是博主整理的MySQL 5.6版本的安装步骤和图解教程,以及安装完成后在DOS命令窗⼝中检验数据库是否可⽤,以便帮助更多的⼈能够更好的掌握此数据库管理系统的操作。

1、点击下载好的安装⽂件,出现下⾯的界⾯。

2、点击图下图红框中的Install MySQL Products 进⼊安装界⾯。

3、勾选I accept the license terms 点击Next4、Find latest products 检查是否有新版本,可以忽略,直接勾选下⽅红框,然后点击Next5、设置,默认选择第⼀个Develeloper Default。

Installation Path安装路径和Data Path 数据⽂件路径可以使⽤默认路径,也可⾃⾏修改。

6、进⼊安装前环境验证,加载完后点击Execute7、程序检测完毕,点击Next8、点击Excute执⾏,等待下载完毕!⽹络不好就稍耐⼼等待...9、全部下载完毕,点击Next10、继续点击下⼀步Next11、如图,勾选后点击Next12、设置密码,如下图上边的Root Account Password ⼀栏,MySQL Root Password:输⼊密码,Repeat Password:重复密码。

13、如下图,MySQL服务配置,Start the MySQL Server at Systen Startup 是开机的时候是否⾃动启动MySQL服务,⼀般为了节省资源我们设为⼿动,即把对勾取消掉,使⽤数据库的时候在右击-->我的电脑-->管理-->服务和应⽤程序-->服务中开启就OK.14、如图所⽰,可取消对勾,点击Next15、点击Next16、继续点击Next17、点击Finish完成以上安装完成后,我们校来校验⼀下安装的MySQL数据库是否可⽤:1、快捷键Windows+R打开命令窗⼝,如下图:2、输⼊cmd确定,进⼊DOS命令窗⼝,找到安装MySQL⽂件夹下的bin⽬录,接着cd C:\Program Files\MySQL\MySQL\MySQL Server 5.6\bin 回车,进⼊到MySQL安装的bin⽬录中。

MySQL5.6_Linux安装

MySQL5.6_Linux安装

Mysql安装过程(linux:2.6.18-194.el5,Mysql:)1、安装[root@RAC2 mysql]# rpm -ivh MySQL-server-5.6.12-2.rhel5.x86_64.rpm Preparing...########################################### [100%]1:MySQL-server########################################### [100%][root@RAC2 mysql]# rpm -ivh MySQL-client-5.6.12-2.rhel5.x86_64.rpm Preparing...########################################### [100%]1:MySQL-client########################################### [100%]2、安装完查看默认3306端口没有开[root@RAC2 mysql]# netstat -natActive Internet connections (servers and established)Proto Recv-Q Send-Q Local Address Foreign Address Statetcp 0 0 0.0.0.0:833 0.0.0.0:* LISTENtcp 0 0 0.0.0.0:111 0.0.0.0:* LISTENtcp 0 0 127.0.0.1:631 0.0.0.0:* LISTENtcp 0 0 127.0.0.1:25 0.0.0.0:* LISTENtcp 0 0 :::22 :::* LISTENtcp 00 ::ffff:192.168.72.5:22 ::ffff:192.168.72.1:63851 ESTABLISHEDtcp 00 ::ffff:192.168.72.5:22 ::ffff:192.168.72.1:62929 ESTABLISHED3、将mysql启动[root@RAC2 init.d]# service mysql startStarting MySQL..[确定]4、再次确认端口是打开的[root@RAC2 init.d]# netstat -natActive Internet connections (servers and established)Proto Recv-Q Send-Q Local Address Foreign Address Statetcp 0 0 0.0.0.0:833 0.0.0.0:* LISTENtcp 0 0 0.0.0.0:111 0.0.0.0:*LISTENtcp 0 0 127.0.0.1:631 0.0.0.0:* LISTENtcp 0 0 127.0.0.1:25 0.0.0.0:* LISTENtcp 0 0 :::3306 :::* LISTENtcp 0 0 :::22 :::* LISTENtcp 00 ::ffff:192.168.72.5:22 ::ffff:192.168.72.1:63851 ESTABLISHEDtcp 00 ::ffff:192.168.72.5:22 ::ffff:192.168.72.1:62929 ESTABLISHED5、连接mysql[root@RAC2 bin]# mysql -u rootERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)在网上查资料,可以这样来解决:[root@RAC2 bin]# /etc/init.d/mysql stopShutting down MySQL..[确定][root@RAC2 bin]# mysqld_safe --user=mysql --skip-grant-tables--skip-networking &[1] 6025[root@RAC2 bin]# 130716 19:00:36 mysqld_safe Logging to'/var/lib/mysql/RAC2.err'.130716 19:00:36 mysqld_safe Starting mysqld daemon with databases from/var/lib/mysql[root@RAC2 bin]# mysql -u root mysqlReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -AWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.6.12 MySQL Community Server (GPL)Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema || test |+--------------------+4 rows in set (0.00 sec)mysql> use mysql;Database changedmysql> show tables;+---------------------------+| Tables_in_mysql |+---------------------------+| columns_priv || db || event || func || general_log || help_category || help_keyword || help_relation || help_topic || innodb_index_stats || innodb_table_stats || ndb_binlog_index || plugin || proc || procs_priv || proxies_priv || servers || slave_master_info || slave_relay_log_info || slave_worker_info || slow_log || tables_priv || time_zone || time_zone_leap_second || time_zone_name || time_zone_transition || time_zone_transition_type || user |+---------------------------+28 rows in set (0.00 sec)mysql> desc user;+------------------------+-----------------------------------+------+-----+---------+-------+| Field | Type | Null | Key | Default | Extra |+------------------------+-----------------------------------+------+-----+---------+-------+| Host | char(60) | NO |PRI | | || User | char(16) | NO |PRI | | || Password | char(41) | NO | | | || Select_priv | enum('N','Y') | NO | | N | || Insert_priv | enum('N','Y') | NO | | N | || Update_priv | enum('N','Y') | NO | | N | || Delete_priv | enum('N','Y') | NO | | N | || Create_priv | enum('N','Y') | NO | | N | || Drop_priv | enum('N','Y') | NO | | N | || Reload_priv | enum('N','Y') | NO | | N | || Shutdown_priv | enum('N','Y') | NO | | N | || Process_priv | enum('N','Y') | NO | | N | || File_priv | enum('N','Y') | NO | | N | || Grant_priv | enum('N','Y') | NO | | N | || References_priv | enum('N','Y') | NO | | N | || Index_priv | enum('N','Y') | NO | | N | || Alter_priv | enum('N','Y') | NO | | N | || Show_db_priv | enum('N','Y') | NO | | N | || Super_priv | enum('N','Y') | NO | | N | || Create_tmp_table_priv | enum('N','Y') | NO || Lock_tables_priv | enum('N','Y') | NO | | N | || Execute_priv | enum('N','Y') | NO | | N | || Repl_slave_priv | enum('N','Y') | NO | | N | || Repl_client_priv | enum('N','Y') | NO | | N | || Create_view_priv | enum('N','Y') | NO | | N | || Show_view_priv | enum('N','Y') | NO | | N | || Create_routine_priv | enum('N','Y') | NO | | N | || Alter_routine_priv | enum('N','Y') | NO | | N | || Create_user_priv | enum('N','Y') | NO | | N | || Event_priv | enum('N','Y') | NO | | N | || Trigger_priv | enum('N','Y') | NO | | N | || Create_tablespace_priv | enum('N','Y') | NO | | N | || ssl_type | enum('','ANY','X509','SPECIFIED') | NO | | | || ssl_cipher | blob | NO | | NULL | || x509_issuer | blob | NO | | NULL | || x509_subject | blob | NO | | NULL | || max_questions | int(11) unsigned | NO | | 0 | || max_updates | int(11) unsigned | NO | | 0 | || max_connections | int(11) unsigned | NO | | 0 | || max_user_connections | int(11) unsigned | NO | | 0 | || plugin | char(64) | YES | | | || authentication_string | text | YES || password_expired | enum('N','Y') | NO | | N | |+------------------------+-----------------------------------+------+-----+---------+-------+43 rows in set (0.00 sec)mysql> select hosr,user,password from user;ERROR 1054 (42S22): Unknown column 'hosr' in 'field list'mysql> select host,user,password from user;+-----------+------+-------------------------------------------+| host | user | password |+-----------+------+-------------------------------------------+| localhost | root | *34F5F8A5C7F9EA100FB15F7FCF1BC31271C3D43C || RAC2 | root | *34F5F8A5C7F9EA100FB15F7FCF1BC31271C3D43C || 127.0.0.1 | root | *34F5F8A5C7F9EA100FB15F7FCF1BC31271C3D43C || ::1 | root | *34F5F8A5C7F9EA100FB15F7FCF1BC31271C3D43C |+-----------+------+-------------------------------------------+4 rows in set (0.00 sec)mysql> update user set password=password('root123') where user='root'and host='localhost';Query OK, 1 row affected (0.00 sec)Rows matched: 1 Changed: 1 Warnings: 0mysql> commit-> ;Query OK, 0 rows affected (0.00 sec)执行下面这一句,是因为上面使表处于:The MySQL server is running with the--skip-grant-tables option,如果不执行下面这句,即使连上数据库也执行不了操作。

mysql 5.6安装

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暂时停止响应新请求之前,短时间内的多少个请求可以被存在堆栈中。

mysql安装图解、mysql5.6.10安装详细图文教程

mysql安装图解、mysql5.6.10安装详细图文教程

mysql安装图解、mysql5.6.10安装详细图文教程出处:西西整理作者:西西日期:2013-3-22 16:14:08 [大中小] 评论: 1 | 我要发表看法MySQL是最受欢迎的开源SQL数据库管理系统,它由MySQL AB开发、发布和支持,MySQL 的执行性能非常高,运行速度非常快,并非常容易使用。

是一个非常捧的数据库,PHP 和MYSQL完美组合。

MYSQL 5.6.10 for win32 英文官方安装版评分:4.0类别:数据库类大小:139.4M 语言:英文查看详细信息>>下载337 次下面的是MySQL安装的图解,用的可执行文件安装的,双击解压缩,运行“setup.exe”,出现如下界面mysql安装图文教程1mysql安装向导启动,按“Next”继续mysql图文安装教程2选择安装类型,有“Typical(默认)”、“Complete(完全)”、“Custom(用户自定义)”三个选项,我们选择“Custom”,有更多的选项,也方便熟悉安装过程:mysql图文安装教程3在“Developer Components(开发者部分)”上左键单击,选择“This feature, and all subfeatures, will be installed on local hard drive.”,即“此部分,及下属子部分内容,全部安装在本地硬盘上”。

在上面的“MySQL Server (mysql服务器)”、“Client Programs(mysql客户端程序)”、“Documentation(文档)”也如此操作,以保证安装所有文件。

点选“Change...”,手动指定安装目录。

mysql图文安装教程4填上安装目录,我的是“F:\Server\MySQL\MySQL Server 5.0”,也建议不要放在与操作系统同一分区,这样可以防止系统备份还原的时候,数据被清空。

CentOS 6.0安装MySQL 5.6及配置

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详细步骤

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的最⼤权限。

ubuntu安装mysql5.6完整步骤说明(亲测实用)

ubuntu安装mysql5.6完整步骤说明(亲测实用)

1.进入mysql官网下载,选择需要的相应版本/downloads/mysql/或者直接迅雷下载这个文件:/archives/mysql-5.6/mysql-5.6.16-linux-glibc2.5-x86_64.tar.gz单击MySQL Community Server选择相应的版本,这里选择5.6.16,linux版下载linux使用官方编译好的二进制包mysql-5.6.16-linux-glibc2.5-x86_64.tar.gz2.上传mysql-5.6.16-linux-glibc2.5-x86_64.tar.gz文件到linux的一个目录3.解压文件到当前目录4.复制解压后的mysql目录到系统本地目录/user/local中不存在mysql文件夹会自动创建5.添加系统mysql组和mysql用户:执行命令:groupadd mysql和useradd -r -g mysql mysql6.安装数据库进入安装mysql软件目录:执行命令cd /usr/local/mysql修改当前目录拥有者为mysql用户:执行命令chown -R mysql:mysql ./安装数据库:执行命令./scripts/mysql_install_db --user=mysql修改当前目录拥有者为root用户:执行命令chown -R root:root ./修改当前data目录拥有者为mysql用户:执行命令chown -R mysql:mysql data到此数据库安装完毕7. 启动mysql服务和添加开机启动mysql服务:添加开机启动:执行命令cp support-files/mysql.server /etc/init.d/mysql,把启动脚本放到开机初始化目录启动mysql服务:执行命令service mysql start执行命令:ps -ef|grep mysql 看到mysql服务说明启动成功,如图8. 修改mysql的root用户密码,root初始密码为空的:执行命令:./bin/mysqladmin -u root password '密码'9.把mysql客户端放到默认路径:ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql注意:建议使用软链过去,不要直接包文件复制,便于系统安装多个版本的mysql到此,mysql正式安装完毕,默认端口是330610.设置root用户允许远程连接。

mysql5.6.37(zip)下载安装配置图文教程

mysql5.6.37(zip)下载安装配置图文教程

mysql5.6.37(zip)下载安装配置图⽂教程
本⽂为⼤家分享了mysql 5.6.37 下载安装配置教程,供⼤家参考,具体内容如下
1.下载
2.下载完成之后解压缩,移动⾄安装⽬录下,建议重命名为:MySQL Server 5.6,我的安装⽬录为:E:\MySQl Server 5.6
3.解压后需要配置环境变量:电脑--属性--⾼级系统设置--环境变量
选择Path,点击编辑,在其变量值后追加:";E:\MySQl Server 5.6\bin",注意:若变量值其后已有“;”,则不需要再次追加“;”,只需填写安装⽬录即可
4.环境配置完成后还需修改配置⽂件,⽂件位置为:E:\MySQl Server
5.6\my-default.ini
5.修改保存之后就可以运⾏cmd(需⽤管理员⾝份运⾏)进⾏安装mysql了
表⽰安装成功
6.启动Mysql服务
7.登录Mysql
注意:第⼀次登录不需要密码,回车即可登录成功,输⼊ \q ,即退出登录
以上就是本⽂的全部内容,希望对⼤家的学习有所帮助,也希望⼤家多多⽀持。

CENTOS7环境安装MySQL5.6(rpm_二进制_源代码编译三种方式)

CENTOS7环境安装MySQL5.6(rpm_二进制_源代码编译三种方式)

CENTOS7环境安装MySQL软件环境虚拟机:VMware® Workstation-10.0.1 build-1379776-Win Linux:Centos 7 X86_64MySQL Database: MySQL-5.6.24系统环境MySQL软件安装一、使用RPM安装。

安装采用RPM安装包安装。

下载mysql:/downloads/mysql/打开页面之后,在Select Platform:下选择linux Generic下载后的包为名称为:MySQL-5.6.24-1.linux_glibc2.5.x86_64.rpm-bundle.tar(一)卸载原有MySQL或者Mariadb安装程序1、CentOs7版本默认情况下安装了mariadb-libs,必须先卸载才可以继续安装MySql。

a) 查找以前是否安装mariadb-libs# rpm -qa | grep -i mariadb-libsb)卸载已经安装的mariadb-libs# yum remove mariadb-libs-5.5.41-2.el7_0.x86_642、查找以前是否安装MySQL# rpm -qa | grep -i mysql--说明已经有安装了MySQL程序a)停止mysql服务# sudo service mysql stop或者:# ps -A | grep mysql# kill -9 进程号b)删除之前安装的mysql# rpm -ve MySQL-server-5.6.24-1.linux_glibc2.5.x86_64# rpm -ve MySQL-client-5.6.24-1.linux_glibc2.5.x86_64c)查找之前老版本mysql的目录、并且删除老版本mysql的文件和库# find / -name mysql【查找结果如下】# find / -name mysql/var/lib/mysql/usr/lib64/mysql/usr/local/mysql/usr/local/mysql/data/mysql【删除对应的目录】# rm -rf /var/lib/mysql# rm -rf /usr/lib64/mysql# rm -rf /usr/local/mysql【删除配置文档】# rm -rf /etc/fd)再次查找机器是否安装mysql# rpm -qa|grep -i mysql【无结果,说明已经卸载彻底、接下来直接安装mysql即可】(二)下载和解压、安装【创建一个任意名称文件夹,如:rpm】# mkdir rpm# cd rpm【下载安装包的压缩文档】# wget /Downloads/MySQL-5.6/MySQL-5.6.17-1.el6.x8 6_64.rpm-bundle.tar# tar –xvf MySQL-5.6.17-1.el6.x86_64.rpm-bundle.tar【创建mysql用户和数据目录】#groupadd mysql#useradd -r -g mysql mysql#cd /usr/local#sudo mkdir mysql#cd mysql#sudo mkdir mysql#sudo chown -R mysql .#sudo chgrp -R mysql .【安装RPM包】#sudo rpm -ivh MySQL-server-5.6.24-1.linux_glibc2.5.x86_64.rpm如果出现错误:FATAL ERROR: please install the following Perl modules beforeexecuting ./scripts/mysql_install_db:Data::Dumper先用yum list 查找下module:# yum list|grep -i perl-modul*# yum install -y perl-Module-Install.noarch#rpm -ev MySQL-server-5.6.24-1.linux_glibc2.5.x86_64重新执行:#sudo rpm -ivh MySQL-server-5.6.24-1.linux_glibc2.5.x86_64.rpm【初始化MySql配置文件】#cp f /etc/f可以简单修改配置如下。

MySQL5.6安装

MySQL5.6安装

1.安装MySQL1)复制文件。

把要安装的文件复制到系统中的【XXX的主文件夹】里(文件在【mysql安装必备】里面)(MySQL-server-5.6.14-1.linux_glibc2.5.i386;MySQL-client-5.6.14-1.linux_glibc2.5.i386)2)安装MySQL进入安装文件所在的目录,打开终端,切换root权限,命令为:……………..>su rootpassword:输入安装命令,首先安装服务器端(server)再安装客户端(client),参照JDK安装:1)安装服务器端运行如下命令:rpm -ivh MySQL-server-5.6.14-1.linux_glibc2.5.i386.rpm显示如下信息。

warning: MySQL-server-5.6.14-1.linux_glibc2.5.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5Preparing...########################################### [100%]1:MySQL-serve ########################################### [100%]。

(省略显示)/usr/bin/mysqladmin -u root password 'new-password'/usr/bin/mysqladmin -u root -h test1 password 'new-password'。

(省略显示)Starting mysqld daemon with databases from /var/lib/mysql如出现如上信息,服务端则安装完毕。

测试是否成功可运行netstat看Mysql端口是否打开,如果打开表示服务已经启动,安装成功。

MYSQL5.6.10+RED-HAT5.5_64位安装说明

MYSQL5.6.10+RED-HAT5.5_64位安装说明

linux下安装mysql参考文档1、安装mysql servier,使用源代码安装,安装包为mysql-5.6.10-linux-glibc2.5-x86_64.tar,代码来源于MYSQL官方下载网站,64位------------------------------------------------------------------------ 注意:安装MYSQL的路径下需要预留足够的表空间,数据文件会存放在MYSQL的跟目录下的MYSQL/DATA/WIPNMS_GZ/下,WIPNMS_GZ为我们使用的DATABASE的名称。

shell> groupadd mysqlshell> useradd -r -g mysql mysqlshell> cd /usr/localshell> tar zxvf /path/to/mysql-version-os.tar.gzshell> cp –a full-path-to-mysql-version-os mysqlshell> cd mysqlshell> chown -r mysql .shell> chgrp -r mysql .shell> mkdir data/logsshell> chown –R mysql.mysql data/logsshell> scripts/mysql_install_db --user=mysqlshell> chown -r root .shell> chown -r mysql datashell> cp support-files/f /etc/fshell> bin/mysqld_safe --user=mysql &shell> cp support-files/mysql.server /etc/init.d/mysqlshell> cp /usr/local/mysql/bin/mysql /usr/binshell> service mysql stopshell> service mysql start------------------------------------------------------------------------ --如果存在报错找不到/tmp/mysql.sock的错误则执行下面的语句shell> cp /usr/local/mysql/data/mysql.sock /tmp/mysql.sock------------------------------------------------------------------------ shell>./bin/mysqladmin -u root –p 'wlanomc';shell> mysql –u root –p--输入密码wlanshell>use mysql安装完成。

win7 64位配置mysql 5.6免安装版,初始化配置和Mysql创建新用户方法 .

win7 64位配置mysql 5.6免安装版,初始化配置和Mysql创建新用户方法 .

以前在windows下用的mysql都是通过下载exe格式的安装包来安装使用,今天偶然下到一个免安装版本的,使用了一番,对mysql的启动之类的有了一个重新认识,记录下。

mysql-5.6.16-win32安装步骤(Windows7 32位)1. 下载/downloads/mysql/5.6.html2. 解压MySQL压缩包将以下载的MySQL压缩包解压到自定义目录下,我的解压目录是:"D:\Program Files\MySQL\mysql-5.6.16-win32"将解压目录下默认文件my-default.ini 拷贝一份,改名my.ini复制下面的配置信息到my.ini 保存#如果没有my-default.ini,可自己新建my.ini或者从其他地方中获取#########################################################[client]port=3306default-character-set=utf8[mysqld]port=3306character_set_server=utf8#character_set_server=utf8 一定要这样写;basedir=D:\Program Files\MySQL\mysql-5.6.16-win32#解压目录datadir=D:\Program Files\MySQL\mysql-5.6.16-win32\data#解压目录下data目录,必须为data目录sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES#########################################################3. 添加环境变量操作如下:在path环境变量下加入:D:\Program Files\MySQL\mysql-5.6.16-win32\bin4. 注册windows系统服务将mysql注册为windows系统服务操作如下:1)从控制台进入到MySQL解压目录下的bin 目录下:2)输入服务安装命令:mysqld-nt --install 一定要在mysql指定的路径下执行,比如X:\mysql\binmysqld install MySQL --defaults-file="D:\ProgramFiles\MySQL\mysql-5.6.16-win32\my.ini"#解压目录下修改的my.ini文件安装成功后会提示服务安装成功。

MySQL5.6(Win764位)下载、安装与配置图文教程

MySQL5.6(Win764位)下载、安装与配置图文教程

MySQL5.6(Win764位)下载、安装与配置图⽂教程MySQL是⽬前⼗分流⾏的⼀种关系型数据库管理系统。

官⽹推出的安装包有两种格式,分别是:ZIP格式和MSI格式。

其中MSI格式的可以直接点击安装,按照它给出的安装提⽰进⾏安装,⼀般MySQL将会安装在C:\Program Files\MySQL\MySQL Server x.x (x.x是版本号)该⽬录中;ZIP格式是⾃⼰解压,解压缩之后MySQL就可以使⽤了,但是要进⾏配置。

我⽤的是ZIP格式的,所以,在此主要叙述ZIP格式的MySQL下载、安装与配置。

⼀.⼯具Win7 64位操作系统⼆.步骤第⼀步:下载安装包定位到MySQL Community Edition关于MySQL的版本,从软件的使⽤授权⾓度来说,分为Community版本和Commercial版本,其中Community版本就是我们通常可以从MySQL官⽅⽹站上可以下载到的社区版,它是基于GPL协议的,只要你的应⽤系统遵循GPL协议⽽开源,或者你的应⽤是内部使⽤,没有通过分销应⽤软件⽽获利的话,或者你开发商业应⽤软件的研发阶段都可以完全免费的使⽤这个Community版本;⽽使⽤MySQL开发商业应⽤时,是⼀定要采⽤Commercial版本才能销售和实现盈利的,即使是你的客户下载安装的MySQL,从遵循软件使⽤授权协议的⾓度来说,也是要购买Commercial版本授权的。

因为最新的版本是5.7,通过右侧选择5.6或者5.5版本截⽌到⽬前(2016/7/24),官⽹的最新版本是5.7.13,不过⾃⼰没有使⽤该版本,下载的是之前的版本5.6.31。

平台默认为Windows。

确认⾃⼰的机器字长,点击download即可。

第⼆步:解压解压之后可以将该⽂件夹改名,放到合适的位置。

我是将⽂件夹改名为MySQL Server 5.6,放到D:\Program Files\MySQL路径中。

win7_64位下如何安装配置mysql_5.6.10_130328

win7_64位下如何安装配置mysql_5.6.10_130328

win7 64位下如何安装配置mysql1、MySQL Community Server 5.6.10官方网站下载mysql-5.6.10-winx64.zip2、解压到d:\MySQL.(路径自己指定)3、在d:\MySQL下新建my.ini配置文件,内容如下:*****************配置文件开始*********************# MySQL Server Instance Configuration File# ---------------------------------------------------------------------- # Generated by the MySQL Server Instance Configuration Wizard### Installation Instructions# ---------------------------------------------------------------------- ### CLIENT SECTION# ----------------------------------------------------------------------# The following options will be read by MySQL client applications.# Note that only client applications shipped by MySQL are guaranteed# to read this section. If you want your own MySQL client program to# honor these values, you need to specify it as an option during the# MySQL client library initialization.#[client]port=3306[mysql]default-character-set=gbk# SERVER SECTION# ----------------------------------------------------------------------## The following options will be read by the MySQL Server. Make sure that# you have installed the server correctly (see above) so it reads this# file.#[mysqld]# The TCP/IP Port the MySQL Server will listen onport=3306#Path to installation directory. All paths are usually resolved relative to this. basedir="d:\MySQL\"#Path to the database rootdatadir="d:\MySQL\Data"[WinMySQLadmin]Server="d:\MySQL\bin\mysqld.exe"# The default character set that will be used when a new schema or table is# created and no character set is defineddefault-character-set=gbk# The default storage engine that will be used when create new tables when default-storage-engine=INNODB# Set the SQL mode to strictsql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"# The maximum amount of concurrent sessions the MySQL server will# allow. One of these connections will be reserved for a user with# SUPER privileges to allow the administrator to login even if the# connection limit has been reached.max_connections=100# Query cache is used to cache SELECT results and later return them# without actual executing the same query once again. Having the query # cache enabled may result in significant speed improvements, if your# have a lot of identical queries and rarely changing tables. See the# "Qcache_lowmem_prunes" status variable to check if the current value # is high enough for your load.# Note: In case your tables change very often or if your queries are# textually different every time, the query cache may result in a# slowdown instead of a performance improvement.query_cache_size=0# The number of open tables for all threads. Increasing this value# increases the number of file descriptors that mysqld requires.# Therefore you have to make sure to set the amount of open files# allowed to at least 4096 in the variable "open-files-limit" in# section [mysqld_safe]table_cache=256# Maximum size for internal (in-memory) temporary tables. If a table# grows larger than this value, it is automatically converted to disk# based table This limitation is for a single table. There can be many # of them.tmp_table_size=26M# How many threads we should keep in a cache for reuse. When a client# disconnects, the client's threads are put in the cache if there aren't # more than thread_cache_size threads from before. This greatly reduces # the amount of thread creations needed if you have a lot of new# connections. (Normally this doesn't give a notable performance# improvement if you have a good thread implementation.)thread_cache_size=8#*** MyISAM Specific options# The maximum size of the temporary file MySQL is allowed to use while # recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.# If the file-size would be bigger than this, the index will be created # through the key cache (which is slower).myisam_max_sort_file_size=100G# If the temporary file used for fast index creation would be bigger# than using the key cache by the amount specified here, then prefer the # key cache method. This is mainly used to force long character keys in # large tables to use the slower key cache method to create the index. myisam_sort_buffer_size=52M# Size of the Key Buffer, used to cache index blocks for MyISAM tables. # Do not set it larger than 30% of your available memory, as some memory # is also required by the OS to cache rows. Even if you're not using# MyISAM tables, you should still set it to 8-64M as it will also be# used for internal temporary disk tables.key_buffer_size=40M# Size of the buffer used for doing full table scans of MyISAM tables. # Allocated per thread, if a full scan is needed.read_buffer_size=64Kread_rnd_buffer_size=256K# This buffer is allocated when MySQL needs to rebuild the index in# REPAIR, OPTIMZE, ALTER table statements as well as in LOAD DATA INFILE # into an empty table. It is allocated per thread so be careful with# large settings.sort_buffer_size=256K#*** INNODB Specific options ***innodb_data_home_dir="d:\MySQL\Data\INNODB\"# Use this option if you have a MySQL server with InnoDB support enabled # but you do not plan to use it. This will save memory and disk space# and speed up some things.#skip-innodb# Additional memory pool that is used by InnoDB to store metadata# information. If InnoDB requires more memory for this purpose it will # start to allocate it from the OS. As this is fast enough on most# recent operating systems, you normally do not need to change this# value. SHOW INNODB STATUS will display the current amount used.innodb_additional_mem_pool_size=2M# If set to 1, InnoDB will flush (fsync) the transaction logs to the# disk at each commit, which offers full ACID behavior. If you are# willing to compromise this safety, and you are running small# transactions, you may set this to 0 or 2 to reduce disk I/O to the# logs. Value 0 means that the log is only written to the log file and# the log file flushed to disk approximately once per second. Value 2# means the log is written to the log file at each commit, but the log# file is only flushed to disk approximately once per second.innodb_flush_log_at_trx_commit=1# The size of the buffer InnoDB uses for buffering log data. As soon as# it is full, InnoDB will have to flush it to disk. As it is flushed# once per second anyway, it does not make sense to have it very large# (even with long transactions).innodb_log_buffer_size=1M# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and# row data. The bigger you set this the less disk I/O is needed to# access data in tables. On a dedicated database server you may set this# parameter up to 80% of the machine physical memory size. Do not set it# too large, though, because competition of the physical memory may# cause paging in the operating system. Note that on 32bit systems you# might be limited to 2-3.5G of user level memory per process, so do not# set it too high.innodb_buffer_pool_size=77M# Size of each log file in a log group. You should set the combined size# of log files to about 25%-100% of your buffer pool size to avoid# unneeded buffer pool flush activity on log file overwrite. However,# note that a larger logfile size will increase the time needed for the# recovery process.innodb_log_file_size=39M# Number of threads allowed inside the InnoDB kernel. The optimal value# depends highly on the application, hardware as well as the OS# scheduler properties. A too high value may lead to thread thrashing.innodb_thread_concurrency=8*****************配置文件结束*********************配置文件也放在了附件里,大家可以根据需要修改。

MySQL5.6_64位安装和链接测试

MySQL5.6_64位安装和链接测试

>grant all PRIVILEGES on test_db.* to root@'192.168.1.101' identified by '123456';
(用于向数据库开放192.168.1.101的链接权限。其中,test_db是mysql的数据库,默认安装时有四个数据库,在登录到mysql的情况下可以使用可以使用>show databases;查看数据库名称。如果要是全网络环境都开放链接权限,将IP地址跟换为%。identified by '123456'是链接密码,可省略)
在Path中添加 %MYSQL_HOME%\bin;
4、使用cmd进入安装路径:cd D:\Applications\MySQL5.6\mysql-5.6.24-winx64\bin
输入服务安装命令: mysqld install MySQL --defaults-file="D:\Applications\MySQL5.6\mysql-5.6.24-winx64\my-default.ini";
1、下载安装相应的MySQL版本,在软件能够下载到最新的MySQL 5.6,这里以win64位为例;
2、将mysql-5.6.24-winx64.1432007928.zip解压到相应的文件夹,该文件夹就是MySQL的安装位置,免安装;
3、添加环境变量:变量名 MYSQL_HOME 变量值 D:\Program Files\mysql-5.6.11-winx64(即解压的路径);
mysql>QUIT
方法二:
利用第三方管理工具进行密码修改。如Navicatfor MySQL

MySQL5.6安装步骤windows764位

MySQL5.6安装步骤windows764位

安装步骤(Wind ows7 64位)1. 下载2.解压 MySQL 压缩包将以下载的MySQL 压缩包解压到自定义目录下。

-3.增加环境变量变量名: MYSQL_HOME变量值:即为 mysql 的自定义解压目录。

再在 Path 中增加%MYSQL_HOME%\bin4. 注册 wind ows 系统服务将mysql 注册为 windows 系统服务操作以下:1)从控制台进入到MySQL 解压目录下的bin 目录下:-2)输入服务安装命令:mysqld install MySQL --defaults-file="D:\Program Files\mysql-5.6.11-winx64\my-default.ini"安装成功后会提示服务安装成功。

注: my-default.ini 文件在 MySQL 解压后的根目录下,若是没有,可从其他地方中获取。

移除服务命令为:mysqld remove5. 启动 MySQL 服务方法一:启动服务命令为:net start mysql方法二:打开管理工具服务,找到MySQL 服务。

经过右键选择启动也许直接点击左边的启动来启动服务。

6.更正 root 账号的密码刚安装完成时 root 账号默认密码为空,此时可以将密码更正为指定的密码。

如:123456-方法一:c:>mysql –urootmysql>show databases;mysql>use mysql;mysql>UPDATE user SET password=PASSWORD("123456") WHERE user='root';mysql>FLUSH PRIVILEGES;mysql>QUIT方法二:利用第三方管理工具进行密码更正。

如Navicat for MySQL。

mysql5.6快速安装及参数详解

mysql5.6快速安装及参数详解

mysql5.6快速安装及参数详解⼀、所需软件软件名称版本下载地址当前环境管理员账号/密码mysql 5.6yum安装centOS6.7系统zxfly/zxfly⼆、安装说明数据库所在⽬录/database/mysql新建⽬录mysqlsock⽂件路径/var/lib/mysql/mysql.sock⾃动⽣成配置⽂件路径/etc/f慢查询⽇志路径/var/log/mysql/mysql_slow_query.log 新建mysql⽇志⽬录错误⽇志路径/var/log/mysql/mysqld.logpid⽂件/var/run/mysqld/mysqld.pid⾃动⽣成binlog⽇志⽂件/database/mysql-bin/mysql_bin*.log新建⽬录mysql-bin三、安装1、下载yum源。

centos7系统:centos6系统:2、安装rpmrpm -Uvh mysql57-community-release-el6-7.noarch.rpm3、修改yum源配置vim /etc/yum.repos.d/mysql-community.repo安装mysql5.6操作1、将enabled=1更改为enabled=02、将enabled=0更改为enabled=1如图:4、安装mysqlyum install mysql-community-server5、替换配置⽂件主库配置⽂件:1 [mysqld]2 user=mysql3 datadir=/database/mysql4 socket=/var/lib/mysql/mysql.sock56 skip-name-resolve79 symbolic-links=01011 #slow_queries12 slow_query_log_file = /var/log/mysql/mysql_slow_query.log13 long_query_time=114 slow_query_log=115 #binlog16 server-id=7717 log_bin=/database/mysql-bin/mysql_bin18 binlog_format=mixed19 expire_logs_days=72021 #innodb22 innodb_buffer_pool_size=104G23 innodb_log_file_size=512M24 innodb_log_buffer_size = 8M25 innodb_flush_log_at_trx_commit=226 innodb_file_per_table=127 innodb_file_io_threads=428 innodb_flush_method=O_DIRECT29 innodb_io_capacity=200030 innodb_io_capacity_max=600031 innodb_lru_scan_depth=200032 innodb_thread_concurrency = 03334 #cache35 ##内部内存临时表的最⼤值36 tmp_table_size=2G37 character-set-server=utf838 collation-server=utf8_general_ci39 ##即跳过外部锁定40 skip-external-locking41 ##MySQL能暂存的连接数量(根据实际设置)42 back_log=102443 ##指定索引缓冲区的⼤⼩,只对MyISAM表起作⽤,这⾥写上也没有关系44 key_buffer_size=1024M45 ##这条指令限定⽤于每个数据库线程的栈⼤⼩46 thread_stack=256k47 ##当⼀个查询不断地扫描某⼀个表,MySQL会为它分配⼀段内存缓冲区48 read_buffer_size=8M49 ##线程缓存50 thread_cache_size=6451 ##查询缓存⼤⼩52 query_cache_size=128M53 ##内部内存临时表的最⼤值,每个线程都要分配54 max_heap_table_size=256M55 ##将查询结果放⼊查询缓存中56 query_cache_type=157 ##代表在事务过程中容纳⼆进制⽇志SQL语句的缓存⼤⼩58 binlog_cache_size = 2M59 ##同样是缓存表⼤⼩60 table_open_cache=12861 ##缓存线程62 thread_cache=10246364 wait_timeout=1800065 ##表和表联接的缓冲区的⼤⼩66 join_buffer_size = 1024M67 ##是⼀个connection级参数,在每个connection第⼀次需要使⽤这个buffer的时候,⼀次性分配设置的内存68 sort_buffer_size=8M69 ##随机读取数据缓冲区使⽤内存70 read_rnd_buffer_size = 8M7172 #connect73 ##是⼀个MySQL中与安全有关的计数器值,它负责阻⽌过多尝试失败的客户端以防⽌暴⼒破解密码74 max-connect-errors=10000075 ##连接数76 max-connections=300077 ##开启查询缓存78 explicit_defaults_for_timestamp=true79 ##mysql服务器能够⼯作在不同的模式下,并能针对不同的客户端以不同的⽅式应⽤这些模式80 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES8182 [mysqldump]83 quick8485 [mysqld_safe]86 log-error=/var/log/mysql/mysqld.log87 pid-file=/var/run/mysqld/mysqld.pidmysql主库配置⽂件从库配置⽂件:1 # For advice on how to change settings please see2 # /doc/refman/5.6/en/server-configuration-defaults.html34 [mysqld]6 # Remove leading # and set to the amount of RAM for the most important data7 # cache in MySQL. Start at 70% of total RAM for dedicated server, else10%.8 # innodb_buffer_pool_size = 128M9 #10 # Remove lead/ing # to turn on a very important data integrity option: logging11 # changes to the binary log between backups.12 # log_bin13 #14 # Remove leading # to set options mainly useful for reporting servers.15 # The server defaults are faster for transactions and fast SELECTs.16 # Adjust sizes as needed, experiment to find the optimal values.17 # join_buffer_size = 128M18 # sort_buffer_size = 2M19 # read_rnd_buffer_size = 2M20 user=mysql21 datadir=/database/mysql22 socket=/var/lib/mysql/mysql.sock23 server-id=214 #以ip为mysql的server-id24 skip-name-resolve2526 # Disabling symbolic-links is recommended to prevent assorted security risks27 symbolic-links=02829 #slow_queries30 slow_query_log_file = /var/log/mysql/mysql_slow_query.log31 long_query_time=132 slow_query_log=13334 #innodb35 innodb_buffer_pool_size=16G36 innodb_log_file_size=512M37 innodb_log_buffer_size = 8M38 innodb_flush_log_at_trx_commit=239 innodb_file_per_table=140 innodb_file_io_threads=441 innodb_flush_method=O_DIRECT42 innodb_io_capacity=200043 innodb_io_capacity_max=600044 innodb_lru_scan_depth=200045 innodb_thread_concurrency = 04647 #cache48 ##内部内存临时表的最⼤值49 tmp_table_size=2G50 character-set-server=utf851 collation-server=utf8_general_ci52 ##即跳过外部锁定53 skip-external-locking54 ##MySQL能暂存的连接数量(根据实际设置)55 back_log=102456 ##指定索引缓冲区的⼤⼩,只对MyISAM表起作⽤,这⾥写上也没有关系57 key_buffer_size=1024M58 ##这条指令限定⽤于每个数据库线程的栈⼤⼩59 thread_stack=256k60 ##当⼀个查询不断地扫描某⼀个表,MySQL会为它分配⼀段内存缓冲区61 read_buffer_size=8M62 ##线程缓存63 thread_cache_size=6464 ##查询缓存⼤⼩65 query_cache_size=128M66 ##内部内存临时表的最⼤值,每个线程都要分配67 max_heap_table_size=256M68 ##将查询结果放⼊查询缓存中69 query_cache_type=170 ##代表在事务过程中容纳⼆进制⽇志SQL语句的缓存⼤⼩71 binlog_cache_size = 2M72 ##同样是缓存表⼤⼩73 table_open_cache=12874 ##缓存线程75 thread_cache=10247677 wait_timeout=1800078 ##表和表联接的缓冲区的⼤⼩79 join_buffer_size = 1024M80 ##是⼀个connection级参数,在每个connection第⼀次需要使⽤这个buffer的时候,⼀次性分配设置的内存81 sort_buffer_size=8M82 ##随机读取数据缓冲区使⽤内存83 read_rnd_buffer_size = 8M8485 #connect86 ##是⼀个MySQL中与安全有关的计数器值,它负责阻⽌过多尝试失败的客户端以防⽌暴⼒破解密码87 max-connect-errors=10000088 ##连接数89 max-connections=300090 ##开启查询缓存91 explicit_defaults_for_timestamp=true92 ##mysql服务器能够⼯作在不同的模式下,并能针对不同的客户端以不同的⽅式应⽤这些模式93 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES95 [mysqldump]96 quick9798 [mysqld_safe]99 log-error=/var/log/mysql/mysqld.log100 pid-file=/var/run/mysqld/mysqld.pidmysql从库配置⽂件复制配置⽂件到/etc/f主库:cp f /etc/f从库:cp my_web_f /etc/f6、编辑配置⽂件:vim /etc/f#修改server-id=171替换成server-id=[配置为安装数据库所在服务器的ip]说明:如果部署的mysql服务是作为从库来使⽤的话,还需要将bin_log项给注释掉。

原:安装版mysql 5.6安装问题

原:安装版mysql 5.6安装问题

安装版mysql 5.6.17版本安装配置问题:201405041,先从360的软件管家里下载mysql 5.6.17,一键下载安装完成2,安装完成后点击:开始——所有程序——MySQL——MySQL Server5.6下面的两个MySQL5.6 Command Line Client和MySQL5.6 Command Line Client-Unicode,都是黑框一闪而过,看不清楚,多次点击无效。

3,为了修正一概而过的问题,点击:开始——所有程序——MySQL——MySQL Server5.6——MySQL5.6 Command Line Client,在MySQL5.6 Command Line Client上面点击鼠标右键,选择属性。

4,跳出属性框:将属性框中的目标(T)中的内容拷贝在记事本中:"C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.exe" "--defaults-file=C:\Program Files\MySQL\MySQL Server 5.6\my.ini" "-uroot" "-p",发现上面拷贝下来的内容中,要求MYSQL安装文件下有my.ini文件,但是发现实际文件夹下没有这个文件,于是将原有的my-default.ini文件复制,并修改名称为my.ini。

5,然后点击:开始——所有程序——MySQL——MySQL Server5.6下面的MySQL5.6 Command Line Client,出现黑框,要求输入密码,因为安装时没有设置密码,所以直接敲回车,却再次出现黑框一闪而过消失的情况:6,为了解决这个问题,进入DOS系统:开始——运行——输入cmd,第一次的界面如下面第一个图所示:图一7,然后输入命令如第二个图所示:进入MYSQL的安装文件夹下的bin目录:图二8,然后再次登录mysql仍然失败,如下面第三个图所示:图三9,打开计算机的服务:控制面板——管理工具——服务,查看发现没有MYSQL的服务,如下面第四个图所示:图四10,此时需要先安装mysql的服务,在dos中输入命令mysqld –install,如下面第五个图所示,发现服务中已经有了MYSQL的服务:图五11,但是该服务是处于停止状态还没有启动,此时打开mysql的cilent客户端,黑框还是一闪而过,需要启动MYSQL服务,启动方式有两种,一种是在dos中输入命令:net start mysql,一种是直接在服务中点击启动,结果却启动失败,如下面第六个图所示:图六12,寻找失败原因发现,是因为没有配置my.ini文件的原因,虽然ini文件已经存在了,但还是需要配置的,尤其是basedir文件和datadir文件,这是两个文件和日志的路径,一定要设置:图七13,此时再重新启动mysql的服务就可以成功了,如下面第八个图所示。

MySQL5.6的zip包安装教程详解

MySQL5.6的zip包安装教程详解

MySQL5.6的zip包安装教程详解之前我们都是后缀为.msi的⽂件,换⾔之就是傻⽠式安装,但是有些版本不容易控制安装路径,或者数据库编码格式,还有些会安装很多⽆⽤的服务,但是都没有后缀为.zip⽂件简单直接,说是在哪⾥,就在哪⾥。

1,⾸先在官⽹下载⼀个合适的mysql版本,有msi⽂件,也有zip⽂件的,先前是下载了两个⼀个是5.7.24但是⾥⾯缺少⼀个⽂件夹:data,还缺少⽂件:my-default.ini⽂件,后来下载了5.6.42的zip压缩包,⾥⾯就什么都有了2,把你下载的zip解压到合适的⽂件夹下⾯,会发现没有my.ini,就需要把my-default.ini复制⼀下,按照这个my.ini命名。

注意:不要将另存为的编码改为UTF-8,必须使⽤默认编码集ANSImy.ini的内容:[mysql]# 设置mysql客户端默认字符集default-character-set=utf8[mysqld]#设置3306端⼝port = 3306# 设置mysql的安装⽬录basedir=E:\SoftWare-SQL\MySQL\mysql-5.6.42-winx64# 设置mysql数据库的数据的存放⽬录datadir=E:\SoftWare-SQL\MySQL\mysql-5.6.42-winx64\data# 允许最⼤连接数max_connections=200# 服务端使⽤的字符集默认为8⽐特编码的latin1字符集character-set-server=utf8# 创建新表时将使⽤的默认存储引擎default-storage-engine=INNODB建完后的⽂件:3.以管理员⽅式进⼊cmd,⼀定要以管理员⽅式进⼊,不然权限不够,进⼊到解压的bin⽬录外⾯输⼊:mysqld install 是安装mysql服务,还有其他语法:mysql remove 是卸载mysql ,net start mysql是启动服务,net stop mysql 是停⽌服务4,输⼊net start mysql :就可以启动服务了,此时可以登陆mysql了,输⼊mysql -u root -p(第⼀次登录没有密码,直接按回车过),登录成功!我这⾥没有截图,就⽤别⼈的图了5,服务启动后,怎么设置密码呢⾸先输⼊exit退出mysql数据库,然后输⼊mysqladmin -u root -p password 回车后提⽰Enter password: 此时直接回车(因为最开始mysql没有设置密码)然后提⽰New password: 输⼊你需要设置的密码并回车,接着提⽰Confirm new password: 此时让你再输⼀次密码并回车,密码修改完毕,先⽤别⼈的图了总结以上所述是⼩编给⼤家介绍的MySQL5.6的zip包安装教程详解,希望对⼤家有所帮助,如果⼤家有任何疑问请给我留⾔,⼩编会及时回复⼤家的。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

下载及安装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所示。

图1.7 安装类型设置窗口
表1-1 安装类型界面各设置项含义
选项含义
Developer Default 默认安装类型
Server only 仅作为服务器
Client only 仅作为客户端
Full完全安装类型
Custom自定义安装类型
Installation Path 应用程序安装路径
Data Path 数据库数据文件的路径
步骤5:选择图1.7中的“Custom”选项,其余保持默认值,然后单击【Next】按钮,弹出功能选择界面,如下图1.8所示。

图1.8 功能选择窗口
步骤6:取消图1.8中“Applications”及“MySQL Connectors”前面的复选框,然后单击【Next】按钮,弹出安装条件检查界面,如下图1.9所示。

图1.9 安装条件检查界面
步骤7:单击【Next】按钮,进行安装界面,如下图1.10所示。

图1.10 程序安装界面
步骤8:单击【Execute】按钮,开始安装程序。

当安装完成之后安装向导过程中所做的设
置将在安装完成之后生效,并会弹出如下图1.11所示的窗口。

步骤9:单击【Next】按钮,会进入服务器配置页面,效果如下图1.12所示。

步骤10:单击【Next】按钮,效果如下图1.13所示。

图1.13 配置页面一
图1.13中的“Server Configuration Type”下面的“Config Type”下拉列表项用来配置当着服务器的类型。

选择哪种服务器将影响到MySQL Configuration Wizard(配置向导)对内存、硬盘和过程或使用的决策,可以选择如下所示的3种服务器类型:
Developer Machine(开发机器):该选项代表典型个人用桌面工作站。

假定机器上运行着多个桌面应用程序。

将MySQL服务器配置成使用最少的系统资源。

Server Machine(服务器):该选项代表服务器,MySQL服务器可以同其它应用程序一起运行,例如FTP、email和web服务器。

MySQL服务器配置成使用适当比例的系统资源。

Dedicated MySQL Server Machine(专用MySQL服务器):该选项代表只运行MySQL服务的服务器。

假定运行没有运行其它应用程序。

MySQL服务器配置成使用所有可用系统资源。

作为初学者,选择“Developer Machine”(开发者机器)已经足够了,这样占用系统的资源不
会很多。

在Enable TCP/IP Networking左边的复选框中可以启用或禁用TCP/IP网络,并配置用来连接MySQL服务器的端口号,默认情况启用TCP/IP网络,默认端口为3306。

要想更改访问MySQL 使用的端口,直接在文本输入框中输入新的端口号即可,但要保证新的端口号没有被占用。

步骤10:单击【Next】按钮,效果如下图1.14所示。

图1.13 配置页面二
步骤11:在图 1.13所对应的界面中,我们需要设置root用户的密码,在“MySQL Root password”(输入新密码)和“Repeat Password”(确认)两个编辑框内输入期望的密码。

也可以单击下面的【Add User】按钮另行添加新的用户。

单击【Next】按钮,效果如下图1.14所示。

图1.14 配置页面三
步骤12:单击【Next】按钮,打开配置信息显示页面,如下图1.15所示。

图1.15 配置信息显示页面
步骤13:单击【Next】按钮,即可完成MySQL数据库的整个安装配置过程。

之后再打开
任务管理器,可以看到MySQL服务进程mysqld.exe已经启动了,如1.16所示。

图1.16 任务管理器窗口
到此为止,我们已经在W indows上顺利的安装了MySQL。

接下来就可以启动MySQL服
务与登录数据库进行自己的操作了。

相关文档
最新文档