绿色版mysql初始化
创建时间:2016-08-02 15:55
本地安装个mysql容易吗.
0x00 准备工作 mysql.zip 下载地址: 我很懒.没找到. 解压并找到对应目录. 修改my.ini文件 默认会有一个my-default.ini文件. 没时间解释了,快copy.
0x01 my.ini utf8 不解释.
1 2 3 4 5 collation-server = utf8_unicode_ci init-connect='SET NAMES utf8' character-set-server = utf8 [client] default-character-set=utf8
0x02 环境变量 添加bin目录到path
0x03 mysql服务初始化 1 2 mysqld --initialize-insecure --user=root mysqld install
0x04 修改root密码 非必须
1 mysqladmin -u root password [密码]
0x05 检查字符集 1 SHOW VARIABLES LIKE 'character%' ;
正常姿势. 坑了也别怕. 因为刚刚安装好. 还可以把服务停了之后去修改my.ini . 重复0x01步骤.
1 2 3 4 5 6 7 8 9 10 11 12 +--------------------------+--------+ | Variable_name | Value | +--------------------------+--------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir |[我删了]| +--------------------------+--------+
0x06 赋权限 1 2 3 4 5 grant [权限1,权限2, ... 或者 all ] on [实例].[表] to '[用户]' @'[ip]' [ identified by '密码' ]; ``` bash IP 可以使用% 做为全网段控制, 通用样例. ``` bash grant all on *.* to 'root' @'%' ;
0x07 删除密码 1 2 3 mysql -u root -p mysql>use mysql; mysql>update user set password='' where user='root' ;
需要重启mysql服务
0x08 服务默认启动 这个应该写在linux服务相关的文档中的.
0x99 其它问题 暂时没有. 哪天有了再补
文章标题: 绿色版mysql初始化
本文作者: zhu8fei
发布时间: 2016-08-02, 15:55:33
最后更新: 2024-08-14, 17:16:35
原始链接: http://www.zhu8fei.com/2016/08/02/mysql-init.html
版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。