当前位置:   article > 正文

一眼就会ubuntu18.04安装jdk,安装mysql5.7及远程访问, 已成功。_ubuntu18安装包安装mysql5.7 tar.gz

ubuntu18安装包安装mysql5.7 tar.gz

  1. jdk:
  2. root@accdxxxce:~# sudo apt-get update
  3. root@accdxxxce:~# sudo apt-get install openjdk-8-jdk
  4. root@accdxxxce:~# java -version
  5. mysql5.7:
  6. root@accdxxxce:~# sudo wget https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb
  7. root@accdxxxce:~# sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb
  8. 选择默认,方向键盘ok确认,选择mysql5.7
  9. root@accdxxxce:~# sudo apt-get update
  10. root@accdxxxce:~# sudo apt-get install mysql-server
  11. root@accdxxxce:~# sudo service mysql status
  12. 设置密码:
  13. root@accdxxxce:~# mysql -uroot -p
  14. 密码处回车。
  15. mysql> show databases;
  16. +--------------------+
  17. | Database |
  18. +--------------------+
  19. | information_schema |
  20. | mysql |
  21. | performance_schema |
  22. | sys |
  23. +--------------------+
  24. 4 rows in set (0.00 sec)
  25. mysql> select user, plugin from mysql.user;
  26. +------------------+-----------------------+
  27. | user | plugin |
  28. +------------------+-----------------------+
  29. | root | auth_socket |
  30. | mysql.session | mysql_native_password |
  31. | mysql.sys | mysql_native_password |
  32. | debian-sys-maint | mysql_native_password |
  33. +------------------+-----------------------+
  34. 4 rows in set (0.00 sec)
  35. mysql> update mysql.user set authentication_string=PASSWORD('123456'), plugin='mysql_native_password' where user='root';
  36. Query OK, 1 row affected, 1 warning (0.00 sec)
  37. Rows matched: 1 Changed: 1 Warnings: 1
  38. mysql> flush privileges;
  39. Query OK, 0 rows affected (0.00 sec)
  40. mysql> exit;
  41. Bye
  42. root@accdxxxce:~# sudo /etc/init.d/mysql restart
  43. [ ok ] Restarting mysql (via systemctl): mysql.service.
  44. 安装vim
  45. root@accdxxxce:~# sudo apt-get install vim
  46. 远程登陆:
  47. root@accdxxxce:~# sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
  48. # 修改配置文件,注释掉bind-address = 127.0.0.1
  49. #进入后先按insert键盘,输入#进行注释,后按esc键盘 输入 :wq 保存退出,(ctrl+z不保存退出)。
  50. root@accdxxxce:~# mysql -uroot -p
  51. Enter password:
  52. Welcome to the MySQL monitor. Commands end with ; or \g.
  53. Your MySQL connection id is 6
  54. Server version: 5.7.26-0ubuntu0.18.04.1 (Ubuntu)
  55. Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
  56. Oracle is a registered trademark of Oracle Corporation and/or its
  57. affiliates. Other names may be trademarks of their respective
  58. owners.
  59. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  60. mysql> grant all on *.* to root@'%' identified by '123456' with grant option;
  61. Query OK, 0 rows affected, 1 warning (0.00 sec)
  62. mysql> flush privileges;
  63. Query OK, 0 rows affected (0.00 sec)
  64. mysql> exit;
  65. Bye
  66. root@accdxxxce:~# sudo /etc/init.d/mysql restart
  67. [ ok ] Restarting mysql (via systemctl): mysql.service.
  68. root@accdxxxce:~#

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

闽ICP备14008679号