Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of integrating mysql with idea

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the method of idea integration mysql, which is introduced in great detail and has certain reference value. Interested friends must read it!

idea integration mysql method: first open the database tool window; then click the Database tool window upper left corner add button "+", select the database type MySQL; finally download the relevant files, fill in the database connection host name, database name, user name and password.

IntelliJ IDEA Integrated MySQL Database Menu View→Tool Windows→Database Open Database Tools window

Click the Add button "+" in the upper left corner of the Database tool window to select the database type MySQL

You will be prompted to download the files, enter the hostname, database name, username, and password for the database connection

Click the Test Connection button to test whether the database connection is normal. The test may give the following error:

Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' property manually.

Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' property manually.

Reason: China time zone is UTC-8, exactly 8 hours from GMT, MySql default time zone is UTC time zone, 8 hours later than Beijing time, resulting in time zone error, so to modify MySql time zone settings.

Fix time zone error:

win+R, bring up the Dos window, start mysql

#View time zones show variables like '%time_zone %';#Set time zones set global time_zone = '+8: 00 ';

Set time zone successfully, check time zone again, display as follows

Note: mysql needs to be restarted to view

Click the Test Connection button again to test whether the database connection is normal

Later I found that this seems to be only a temporary solution, can not be solved at one time, the following update the content, directly in IDEA to modify

serverTimezone can be Asia/Shanghai

Or Hongkong or Asia/Hongkong

Learn how to create a library using SQL on IDEA. Here is a jd.sql test for creating a database table

DROP database IF EXISTS `jd`;create database jd;use jd;DROP database IF EXISTS `jd_item`; CREATE TABLE `jd_item`( `id` bigint(10) NOT NULL AUTO_INCREMENT COMMENT 'primary key id',`spu` bigint(15) DEFAULT NULL COMMENT ' item set id',`sku` bigint(15) DEFAULT NULL COMMENT 'item minimum category unit',`title` varchar(100) DEFAULT NULL COMMENT 'Item title',`price` bigint(10) DEFAULT NULL COMMENT ' Item price',`pic` varchar(200) DEFAULT NULL COMMENT 'Item picture',`url` varchar(200) DEFAULT COMMENT ' Item detail address',`created` datetime DEFAULT NULL COMMENT 'creation time',`updated` datetime DEFAULT NULL COMMENT ' update time', PRIMARY KEY (`id`), KEY `sku` (`sku`) USING BTREE) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='Jingdong Commodity Table';

Right click on sql, database jd and data table jd_item appear on the right after execution

The above is all the content of idea integration mysql method, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report