当前位置:   article > 正文

ubuntu系统安装jdk 、mysql_ubuntu 一键安装 jdk muysql

ubuntu 一键安装 jdk muysql

**

安装mysql

**
(1)安装mysql
apt-get update
apt-get install mysql-server
(2)设置mysql
service mysql stop
vim /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 0.0.0.0
service mysql start
(3)查看用户名和密码
sudo cat /etc/mysql/debian.cnf
在这里插入图片描述
使用账户和密码登录:
mysql –h 127.0.0.1 –u debian-sys-maint –p
(4) 创建新用户并且授权
use mysql
mysql> create user ‘root’@‘%’ identified by ‘123456’;
mysql> grant all privileges on . to ‘root’@‘%’;
mysql> ALTER USER ‘root’@‘%’ IDENTIFIED WITH mysql_native_password BY ‘123456’;
mysql> flush privileges;
(5)查看用户及权限
mysql> use mysql;
mysql> select host, user, authentication_string, plugin from user;
**

卸载命令:
sudo apt purge mysql-*
sudo rm -rf /etc/mysql/ /var/lib/mysql
sudo apt autoremove
sudo apt autoclean

遇到错误:
1、### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘ts.count’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

解决办法:登录mysql 执行命令:select @@global.sql_mode;
设置模式 set @@global.sql_mode=‘STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION’;

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/841096
推荐阅读
相关标签
  

闽ICP备14008679号