ubuntu16.04下安装 java8 和 Mysql 5.6.40

安装工具推荐 winscp 免费,中文,好用!

Ubuntu 报错:

 报错误1: add-apt-repository: command not found

 报错误2:Package 'python-software-properties' has no installation candidate

解决如下:

  # apt-get update
  # apt-get upgrade

  # sudo apt-get install software-properties-common python-software-properties  

安装Java 8 :

  # sudo add-apt-repository ppa:webupd8team/java

  # apt-get update

  # sudo apt-get install oracle-java8-installer

  # sudo update-java-alternatives -s java-8-oracle

  # java -version

  # javac -version

安装Mysql 5.6.40 deb包

  

# sudo apt-get autoremove --purge mysql-server-5.*
# sudo apt-get remove mysql-server
# sudo apt-get autoremove mysql-server
# sudo apt-get remove mysql-common

# sudo apt-get install libaio-dev
# sudo apt-get install libmecab2

# wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-server_5.6.40-1ubuntu14.04_amd64.deb-bundle.tar

# tar -xvf mysql-server_5.6.40-1ubuntu14.04_amd64.deb-bundle.tar

1. # sudo dpkg -i mysql-common_5.6.40-1ubuntu14.04_amd64.deb
2. # sudo dpkg -i libmysqlclient18_5.6.40-1ubuntu14.04_amd64.deb
3. # sudo dpkg -i libmysqlclient-dev_5.6.40-1ubuntu14.04_amd64.deb
4. # sudo dpkg -i libmysqld-dev_5.6.40-1ubuntu14.04_amd64.deb
5. # sudo dpkg -i mysql-community-client_5.6.40-1ubuntu14.04_amd64.deb
6. # sudo dpkg -i mysql-client_5.6.40-1ubuntu14.04_amd64.deb
7. # sudo dpkg -i mysql-community-server_5.6.40-1ubuntu14.04_amd64.deb
8. # sudo dpkg -i mysql-server_5.6.40-1ubuntu14.04_amd64.deb

9. 开启远程访问 ,修改/etc/mysql/mysql.conf.d/mysqld.cnf如下:

[mysqld]
bind-address = 0.0.0.0

10.开启远程访问
mysql -uroot -p
mysql>CREATE USER '自定义授权用户名'@'localhost' IDENTIFIED BY '自定义授权密码';
mysql>CREATE USER '自定义授权用户名'@'%' IDENTIFIED BY '自定义授权密码';
mysql>GRANT ALL ON *.* TO '自定义授权用户名'@'localhost';
mysql>GRANT ALL ON *.* TO '自定义授权用户名'@'%';
mysql>flush privileges;

  service mysql start

  service mysql stop 

  mysql -u root -p 

  show variables like "char%"; 

  show global variables like "%datadir%"; 查看MySQL安装的全局信息

 

posted @ 2018-06-13 17:48  阿强是小兵  阅读(965)  评论(0编辑  收藏  举报