Linux安装MySQL遇到的问题
安装:
https://www.cnblogs.com/fnlingnzb-learner/p/5830622.html
https://www.cnblogs.com/xinjing-jingxin/p/8025805.html
https://www.cnblogs.com/xxoome/p/5864912.html
https://www.cnblogs.com/bookwed/p/5896619.html
1、解压到当前目录
tar -xvzf mysql-5.6.42-linux-glibc2.12-x86_64.tar.gz
2、复制到mysql目录
cp mysql-5.6.42-linux-glibc2.12-x86_64 /usr/local/mysql -r
3、添加系统mysql组和mysql用户
groupadd mysql和useradd -r -g mysql mysql
4、安装数据库
进入安装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
5、安装完成
开启远程连接:
https://www.cnblogs.com/pqy521/p/7111268.html
一、MySQL5.6 Using a password on the command line interface can be insecure解决方法;
原因:
官方网址:http://dev.mysql.com/doc/refman/5.1/en/password-security-user.html
MySQL users shoulduse the following guidelines to keep passwords secure.
When you run a client program to connect to the MySQL server, it is inadvisableto specify your password in a way that exposes it to discovery by other users.The methods you can use to specify your password when you run client programsare
listed here, along with an assessment of the risks of each method. Inshort, the safest methods are to have the client program prompt for thepassword or to specify the password in a properly protected option file.
翻译过来大意是在命令行下如果要使用密码可以在执行命令后的提示输入里输入密码,或者在指定的安全文件内指定密码;那安全文件时哪个呢?文档对此给出了答案:
Store your passwordin an option file. For example, on Unix, you can list your password in the[client] section of the .my.cnf file in your home directory:
1.针对mysql:
mysql -u root -pPASSWORD改成mysql -u root -p 在输入密码即可.
2.mysqldump就比较麻烦了,通常都写在scripts脚本中;
解决方法:
对于mysqldump 要如何避免出现(Warning:Using a password on the command line interface can be insecure.) 警告信息呢?
vim /etc/mysql/my.cnf
[mysqldump]
user=your_backup_user_name
password=your_backup_password
修改完配置文件后, 只需要执行mysqldump 脚本就可以了;备份脚本中不需要涉及用户名密码相关信息;
我用的是第一种,第二种没试过。
二、Centos下Mysql因为pid文件启动失败问题解析
> service mysql start
Starting MySQL.. ERROR! The server quit without updating PID file (/var/run/mariadb/mariadb.pid).
cat /var/log/mariadb/mariadb.log
...
171112 11:18:38 [ERROR] /usr/sbin/mysqld: Can't create/write to file '/var/run/mariadb/mariadb.pid' (Errcode: 2)
171112 11:18:38 [ERROR] Can't start server: can't create PID file: No such file or directory
我看了下,的确文件、文件都不存在,我的解决办法是:
> mkdir /var/run/mariadb
> chown mysql.mysql /var/run/mariadb/
最后,重启MySQL,成功。
> service mysql start
Starting MySQL.. SUCCESS!
三、mysql.sock问题(解决方法很多,这只是其中一个)
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
这是可以由于系统默认的文件位置和文件位置不一致,解决办法找到文件创建软链接
find / -name mysql.sock
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
四、 FATAL ERROR: please install the following Perl modules before executing scripts/mysql_install_db:
Data::Dumper
#解决方法:
yum install -y perl-Data-Dumper
五、mysqld_safe Directory '/var/lib/mysql' for UNIX socket file don't exists.
https://blog.csdn.net/qq_32331073/article/details/76229420
六、MySQL: Starting MySQL….. ERROR! The server quit without updating PID file解决办法
https://blog.csdn.net/orichisonic/article/details/47021379
七、如果是阿里云服务器 需要注意

这地方也需要开启相关的端口,不然仅仅是linux开启防火墙不行
Linux安装MySQL遇到的问题的更多相关文章
- linux安装mysql后root无法登录 sql 无法登录
linux安装mysql后root无法登录 问题:[root@localhost mysql]# mysql -u root -pEnter password: ERROR 1045 (28000): ...
- linux安装mysql~~~mysql5.6.12
Linux安装mysql服务器 准备: MySQL-client-5.6.12-1.rhel5.i386.rpm MySQL-server-5.6.12-1.rhel5.i386.rpm 首先检查环境 ...
- linux安装mysql全纪录[包括yum和rpm安装,编码,远程连接以及大小写问题]
linux安装mysql全纪录[包括yum和rpm安装,编码,远程连接以及大小写问题] 一.查看mysql是否已经安装 使用“whereis mysql”命令来查看mysql安装路径: [root@h ...
- linux安装mysql服务分两种安装方法:
linux安装mysql服务分两种安装方法: ①源码安装,优点是安装包比较小,只有十多M,缺点是安装依赖的库多,安装编译时间长,安装步骤复杂容易出错: ②使用官方编译好的二进制文件安装,优点是安装速度 ...
- linux安装MySQL后输入mysql显示 ERROR 2002 (HY000): Can't connect to local MySQL server through socket
我是小白,大佬勿喷 *** linux安装MySQL后输入mysql显示 ERROR 2002 (HY000): Can't connect to local MySQL server through ...
- Linux 安装Mysql(图文教程)
原文:Linux 安装Mysql(图文教程) 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net ...
- Linux 安装 MySQL 8 数据库(图文详细教程)
本教程手把手教你如何在 Linux 安装 MySQL 数据库,以 CentOS 7为例. 1. 下载并安装 MySQL 官方的 Yum Repository wget -i -c https://re ...
- linux 安装mysql数据库——yum安装法
mysql数据库有多种安装方式,本文只介绍在Linux服务器上最实用.最快捷的mysql server安装方法.一.Linux服务器yum安装(CentOS6.3 64位) 所有在服务器上执行的命令, ...
- 虚拟机下linux安装mysql,apache和php
由于腿伤了,卧床在家折腾下linux,尝试用虚拟机装mysql,apche和php.中间各种波折,装了好几天,觉得有些经验还是要记录下来,让自己别忘了:) 按照下面这篇文章的方法,基本可以顺利安装成功 ...
- 在linux安装mysql,并设置远程访问
1.查看系统有没有安装mysql. vpm -qa mysql 发现有删除:rpm -e mysql(rpm -e --nodeps mysql) 2.下载数据库 mysql-standard-5.0 ...
随机推荐
- 浅谈Java中的equals和==(转载)
在初学Java时,可能会经常碰到下面的代码: 1 String str1 = new String("hello"); 2 String str2 = new String(&qu ...
- python采用pika库使用rabbitmq总结,多篇笔记和示例(转)
add by zhj:作者的几篇文章参考了Rabbitmq的Tutorials中的几篇文章. 原文:http://www.01happy.com/python-pika-rabbitmq-summar ...
- PHP函数处理方法总结
call_user_func_array (PHP 4 >= 4.0.4, PHP 5, PHP 7) call_user_func_array — 调用回调函数,并把一个数组参数作为回调函数的 ...
- Openstack(七)keystone
官方安装文档:https://docs.openstack.org/ocata/zh_CN/install-guide-rdo/index.html 7.1 keystone简介 Keystone 中 ...
- WordPress配置
1.准备工作: 下载comsenzexp.exe 下载wordpress.zip 2.安装comsenzexp.exe,安装有个wwwroot目录: 3.解压wordpress.zip,然后ctrl+ ...
- (13)如何使用Cocos2d-x 3.0制作基于tilemap的游戏:第一部分
引言 程序截图: 本教程将会教大家如何使用Cocos2d-x来做一个基于tile地图的游戏,当然还有Tiled地图编辑器.(我们小时候玩的小霸王小学机里面的游戏,大部分都是基于tile地图的游戏,如坦 ...
- 466E - Information Graph 巧妙的判断祖先于孩子的关系
这题说的是给了一个公司员工100000 然后现在又3种操作第一种将y置为x的父亲,第二种操作将文件给第x个人签他签完给他的上司签,一直到没有上司为止,第三种操作问x是否签了第i份文件,然后 我们只要直 ...
- python中format函数
python中format函数用于字符串的格式化 通过关键字 1 print('{名字}今天{动作}'.format(名字='陈某某',动作='拍视频'))#通过关键字 2 grade = {'nam ...
- 使用vux实现上拉刷新的总结
最近公司在研发app,选择了基于Vue框架的vux组件库,现总结在实现上拉刷新功能遇到的坑: 1.问题:只刷新一次,解决方法:需要自己手动重置状态 this.scrollerStatus.pullup ...
- 20145312《网络对抗》Exp4 恶意代码分析
20145312<网络对抗>Exp4 恶意代码分析 问题回答 1.总结一下监控一个系统通常需要监控什么.用什么来监控. 监控一个系统通常需要监控这个系统的注册表,进程,开放端口,程序服务还 ...