MySQL 5.6.24配置安装
MySQL安装配置教程

MySql8.0安装配置
1.解压文件到某个目录
这里我将“mysql-8.0.29-win64”解压到“D:\program files\mysql-8.0.29-winx64”目录下
2.添加环境变量
由于我的mysql不是安装版,直接将文件解压后要配置环境变量,配置方式如下:
⏹此电脑–>属性–>高级–>环境变量
⏹选择path添加:mysql安装目录下的bin文件夹地址
3.创建mysql的配置文件
在自己的mysql解压目录下,新建一个my.ini文件,输入如下内容,请把:D:\program files\mysql-8.0.29-winx64改成自己的路径
用管理模式打开命令行窗口,切换到mysql的bin目录下,输入mysqld –install命令来安装服务
5、初始化数据文件
在命令行窗口继续输入mysqld --initialize-insecure --user=mysql命令,此时在mysql解压目录下会多出一个data文件夹,里面包含了初始化后的数据文件
在命令行窗口中继续输入”net start mysql”命令,来启动mysql的服务
7、修改mysql登录密码
按下windows键+R键,打开cmd窗口,输入”mysql –u root –p,要求输入密码,此时密码为空,按回车就可以进入mysql,但是为了安全要及时修改密码,在cmd的窗口中输入:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码'; 不要忘了最后的分号,我忘了以后第二行又敲了一个,之后按回车即可。
MySQL5.6版本安装及配置过程

编辑者:Vocabulary下面详细介绍5.6版本MySQL的下载、安装及配置过程。
图1.1 MySQL5.6目前针对不同用户,MySQL提供了2个不同的版本:MySQL Community Server:社区版,该版本完全免费,但是官方不提供技术支持。
MySQL Enterprise Server:企业版,它能够高性价比的为企业提供数据仓库应用,支持ACID事物处理,提供完整的提交、回滚、崩溃恢复和行级锁定功能。
但是该版本需付费使用,官方提供电话及文档等技术支持。
目前最新的MySQL版本为MySQL 5.6,可以在官方网站/downloads/下载该软件。
下图1.2所示的MySQL官网上单击图片上的“Download”超链接或点击左边标记处,然后按照提示一步步操作就可以将MySQL软件下载到本地计算机中了。
注意这里我们选择的是数据库版本是“Windows (x86, 32-bit), MSI Installer”,如下图1.3所示。
图1.2 MySQL官方网站图1.3 选择MySQL版本当点击download后会弹出如下页面:注:下载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所示。
mysql安装配置教程

mysql安装配置教程1.mysql下载 2.mysql安装规范 MySQL安装⽅式:推荐使⽤⼆进制安装(其他安装⽅式:源码编译安装、yum、rpm) MySQL运⾏⽤户:mysql:mysql注意该⽤户是虚拟⽤户,只是⽤于mysql进程运⾏使⽤,不允许登录、不创建家⽬录 MySQL⽬录规范: 下载⽬录/server/tools 系统⽬录/opt/mysql/mysql-xx.xx 软连接ln-s/opt/mysql/mysql-xx.xx /usr/local/mysql 数据⽬录/data/mysql/mysql+port/{data,logs} 配置⽂件/data/mysql/mysql+port/my+f 3.⼆进制安装MySQL5.7.26(该⽅式⽤于在linux系统下安装) Linux操作系统安装MySQL 。
创建MySQL虚拟⽤户 useradd -s /sbin/nologin -M mysql #创建⽤户命令 id mysql #查看是否创建成功 。
创建⽬录 mkdir -p /server/tools mkdir -p /opt/mysql mkdir -p /data/mysql/mysql3306/{data,logs} cd /server/tools #进⼊到该⽬录 。
将下载的⽂件上传 rz #上传mysql⼆进制⽂件 ll #查看⽂件是否上传成功 yum install -y lrzsz #如没有rz命令,可通过yum安装 。
解压⼆进制包 tar xf mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz 。
将软件部分移动到指定⽬录 mv mysql-5.7.26-linux-glibc2.12-x86_64 /opt/mysql/mysql-5.7.26 。
创建软连接 ln -s /opt/mysql/mysql-5.7.26/ /usr/local/mysql 。
MySQL5.0安装配置详细流程

MySQL5.0安装配置详细流程MySQL 5.0安装配置流程1、安装类型选择⾃定义安装,默认下⼀步并跳过注册(Skip Sign-up),接着开始进⾏配置2、配置类型选择详细配置(Detailed Configuration)3、服务类型Developer Machine(开发测试类,mysql占⽤很少资源)Server Machine(服务器类型,mysql占⽤较多资源)Dedicated MySQL Server Machine(专门的数据库服务器,mysql占⽤所有可⽤资源)4、数据库⽤途Multifunctional Database(通⽤多功能型,好)Transactional Database Only(服务器类型,专注于事务处理,⼀般)Non-Transactional Database Only(⾮事务处理型,较简单,主要做⼀些监控、记数⽤,对MyISAM数据类型的⽀持仅限于non-transactional)5、InnoDB 数据库⽂件不更改InnoDB 数据库⽂件的存储位置,默认下⼀步即可6、访问量Decision Support(DSS)/OLAP(20个左右的同时连接数)Online Transaction Processing(OLTP)(500个左右的同时连接数)Manual Setting(⼿动设置,⾃⼰输⼀个数,根据实际情况选择)7、⽹络和模式Enable TCP/IP Networking(默认勾选不做更改,取消就只有⾃⼰机器能访问)Enable Strict Mode(使⽤严格模式,建议开启,默认开启不更改)8、编码Standard Character Set(标准字符,默认Latin1,适⽤于英语和其他西欧语⾔)Best Support For Multilingualism(多语种,默认UTF8,可存储多种不同语⾔的⽂本)Manual Selected Default Character Set/ Collation(⼿动选择默认字符集/排序规则,可以选gbk、gb2312、utf8)gb2312是简体中⽂的码,gbk⽀持简体中⽂及繁体中⽂,big5是繁体中⽂,utf8⽀持⼏乎所有字符,上⾯那个选第⼆个也没啥问题9、Windows服务Install As Windows Service(将mysql安装为windows服务,默认即可)Include Bin Directory in Windows PATH (将mysql的bin⽬录加⼊到Windows PATH,很⽅便,但我⽤不到)10、安全Modify Security Settings(默认勾选,并在下⾯新建连接密码)Enable root access from remote machines(允许root⽤户远程访问,考虑到安全性也可以不勾选)Create An Anonymous Account(新建匿名⽤户,可以连接,但不能操作数据,可能导致不安全,⼀般不勾选)如果是重装,并且之前已经设置了密码,密码处请留空,并将“Modify Security Settings”前⾯的勾去掉,安装配置完成后另⾏修改密码。
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以上就是本⽂的全部内容,希望对⼤家的学习有所帮助,也希望⼤家多多⽀持。
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,让其可以在本机上登录,并对所有数据库有查询、插入、修改、删除的权限。
第2章 MySQL的安装与配置

— 12 —
2.1 在Windows操作系统下安装与配置MySQL ➢ 2.1.2 安装与配置MySQL
步骤8 右击“此电脑”图标,在弹出
的快捷菜单中选择“属性”,打开“系统” 窗口,然后单击窗口左侧列表中的“高级 系统设置”项,如左图所示。
打开高级系统设置
— 13 —
2.1 在Windows操作系统下安装与配置MySQL ➢ 2.1.2 安装与配置MySQL
# 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模式 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLE S
按钮,执行“命令提示符(管理 员)”命令,打开命令行窗口,如 左图所示。
—9—
2.1 在Windows操作系统下安装与配置MySQL ➢ 2.1.2 安装与配置MySQL
步骤5
在窗口中输入“F:”命令并按回车键确认,跳转到F盘根目录,然后
输 入 “ cd mysql-5.7.18-winx64\bin ” 并 按 回 车 键 确 认 , 跳 转 到 “ F:\mysql-
提示
用 户 可 以 把 MySQL 安 装 在 系 统 盘 , 也 可以安装在其他盘,但实际应用中,数据目 录一般不会设在系统盘,因为随着系统运行 时间的推移,数据量会越来越大。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
1、解压文件
2、将解压目录下默认文件my-default.ini 拷贝一份,改名my.ini
复制下面的配置信息到my.ini 保存
3、打开my.ini文件,输入一下文件
[client]
port=3306
default-character-set=utf8
[mysqld]
port=3306
character_set_server=utf8
basedir=E:\mysql-5.6.24-win32
#解压目录
datadir=E:\mysql-5.6.24-win32\data
#解压目录下data目录
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [WinMySQLAdmin]
E:\mysql-5.6.24-win32\bin\mysqld.exe
下图是原先的文档
输入完以上信息后是这样的:
4、添加环境变量
操作如下:
1)右键单击我的电脑->属性->高级系统设置(高级)->环境变量
点击系统变量下的新建按钮
输入变量名:MYSQL_HOME
输入变量值:E:\mysql-5.6.24-win32
#即为mysql的自定义解压目录。
2)选择系统变量中的Path
点击编辑按钮
在变量值中添加变量值:%MYSQL_HOME%\bin
注意是在原有变量值后面加上这个变量,用;隔开,不能删除原来的变量值,5、将mysql注册为windows系统服务
1)从控制台进入到MySQL解压目录下的bin 目录下:
E:
cd E:\mysql-5.6.24-win32\bin
2)输入服务安装命令:
mysqld install MySQL --defaults-file=”E:\mysql-5.6.24-win32\my.ini”
移除服务命令为:mysqld remove(不过需要先停止mysql服务)
6、启动MySQL服务
方法一:
启动服务命令为:net start mysql
方法二:
打开管理工具服务,找到MySQL服务。
通过右键选择启动或者直接点击左边的启动来启动服务。
7、修改root 账号的密码
刚安装完成时root账号默认密码为空,此时可以将密码修改为指定的密码。
如:123456
E:\mysql-5.6.24-win32\bin>mysql -u root -p
mysql>show databases;
mysql>use mysql;
mysql>UPDATE user SET password=PASSWORD("123456") WHERE user='root'或者 E:\mysql-5.6.24-win32\bin\ mysqladmin -uroot -p password <新密码>
mysql>FLUSH PRIVILEGES;
mysql>QUIT
另方法:
grant all on *.* to 'root'@'localhost' IDENTIFIED BY 'liya19830512' with grant option
update user set password=password('liya19830512 ') where user='root'
到此已经全部配置成功。
可以用Navicate for mysql 进行更有效的连接管理mysql。