当前位置:网站首页>Detailed tutorial on installing MySQL 8.0 + eclipse configuration under Linux
Detailed tutorial on installing MySQL 8.0 + eclipse configuration under Linux
2022-04-22 19:57:00 【I love machine learning】
Catalog
install MySql:
I use it Ubuntu20.04, So use the following command to install directly :
sudo apt-get install mysql-server
If other, you can update the source first :
sudo apt-get update
Check whether the installation is successful :
systemctl status mysql

start-up mysql:
sudo mysql // No password required , It's fine too su Enter the super user and directly use mysql
// perhaps
mysql -u root -p // You need to enter a password

mysql A password is automatically generated , Check the method :
sudo cat /etc/mysql/debian.cnf

thus Mysql Installation successful , The initial password has also been .
eclipse To configure mysql:
Go to MySQL Official website download Java Of JDBC.
Operation as shown in figure :






Unzip the downloaded file .

open eclipse => Window => Preferences
I have created JDBC One, so he reported a mistake .

Go back to the interface just now :

Find the folder you just extracted , choice jar package , And then click OK, Save it :

On the right side, click the highest level project file , And then right-click => Build Path => Configure Build Path...:

After checking , Click finish , Save to exit . I've already done it , So I can't order here .

And then create a new one .java file , Enter the following code to verify the successful connection MySQL.
import java.sql.*;
public class test05 {
public static void main(String args[]) {
Connection conn=null;
try {
Class.forName("com.mysql.cj.jdbc.Driver");
System.out.println("Success!");
}
catch (Exception e) {
System.out.print("Error!");
e.printStackTrace();
}
try {
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "debian-sys-maint", "VShIsIqvYFvcb5q1");
System.out.println("Success!");
conn.close();
}
catch (Exception e) {
System.out.print("get data error!");
e.printStackTrace();
}
}
}
The configuration is successful by outputting the following results :

版权声明
本文为[I love machine learning]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221952449983.html
边栏推荐
- DNS resolution process & Basics
- 闭包的概念、作用、问题及解决方式
- 网络隧道技术
- Packaging PHP with rpmbuild
- Format for creating Zimbra LDAP users using LDAP clients
- quarkus依赖注入之九:bean读写锁
- Learning Android VI from scratch -- data persistence
- Problems that must be avoided in the process of top survey technology sorting and transformation
- Network tunneling technology
- 短信驗證兩種定時禁用處理機制及區別
猜你喜欢

海康内置4G卡的摄像头设备无法注册EasyCVR平台是什么原因?

哪个品牌的运动耳机比较好、好用的运动耳机推荐

Format for creating Zimbra LDAP users using LDAP clients

看大网站如何玩转网站加速(CDN)的秘密

顶测科技整理转行过程中一定要避免的问题

EasyCVR流媒体内核无法启动是什么原因?

面试千万不要这么说,“不喜欢开发,所以选择测试”

JMeter: an introduction to the basic knowledge of 2000 word interface testing

DNS resolution process & Basics
![[eight part essay] thread safety](/img/64/9508be7c7cb39a41a5ba4ecd611ee8.png)
[eight part essay] thread safety
随机推荐
[program source code] graduation project - film website
Time format of go language
Why puddingswap may be a strong dark horse in the field of gamefi?
应届毕业生的头一份工作有多重要?
Why is x16 slower than X8?
从功能测试到自动化测试,待遇翻倍,我整理了这一份3000字超全学习指南
CVPR 2022:微笑识别也带性别歧视?浙大武大联合蚂蚁Adobe搞了个公平性提升框架
[eight part essay] redis cache
图像预训练模型的起源解说和使用示例
Hard work alone is not enough! And this
Firewalld DBUS interface usage guide
怎么才能申购可转债呢?申购可转债安全吗?
2021-06-10 axure本地发布
传:阿里达摩院裁员30%! 内部员工:谣言! 网友:要不裁29.99%。。。
Special analysis of China's digital technology in 2022
Industry trends are far more important than efforts -- top test technology summary
[basic knowledge of automated testing] basic concepts and common frameworks of automated testing
What is the reason why the camera device with built-in 4G card of Haikang cannot register with easycvr platform?
面试千万不要这么说,“不喜欢开发,所以选择测试”
EasyCVR流媒体内核无法启动是什么原因?