5.6版本MySQL的下载、安装及配置过程
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安装

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安装

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安装详细图文教程出处:西西整理作者:西西日期: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及配置从今年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的最⼤权限。
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)下载安装配置图⽂教程
本⽂为⼤家分享了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 ,即退出登录
以上就是本⽂的全部内容,希望对⼤家的学习有所帮助,也希望⼤家多多⽀持。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 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服
务与登录数据库进行自己的操作了。