In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Next, let's learn about the mysql problems we often encounter. I believe you will benefit a lot after reading it. The text is not in the essence. I hope you will often encounter the mysql problems in this short article.
Date type data
Datetime only supports mysql 5.6.5clients. Older versions need to use timestamp.
Example:
Alter table table_name change column1 column1 timestamp default current_timestamp
Set the field type to the date type, and the default value is the current time
Stored procedure
In fact, the stored procedure is a bunch of commonly used sql statements, operations, defined as a collection, functions, need to be called directly to reduce the workload.
If an error occurs under the cmd command line, execute delimiter / / first and change the delimiter from; to / /
Create procedure p1 () begin select * from table1; select * from teble2;end
Trigger
DELIMITER / / CREATE TRIGGER tr1 BEFORE INSERT ON test1 FOR EACH ROW / / creates a trigger that, when performing a test1 insert operation, performs the following actions BEGININSERT INTO USER VALUES ('sss',123,' Wowa, 4); END//INSERT INTO test1 (NAME,tel) VALUES (' aa',12345)
Create a table, or if it does not exist
CREATE TABLE IF NOT EXISTS test2 (id INTEGER AUTO_INCREMENT, NAME VARCHAR (20) NOT NULL, address VARCHAR (20) NULL, borthdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id)) ENGINE=INNODB DEFAULT CHARSET=utf8;INSERT INTO test2 (NAME,address) VALUES
5. Remote access to the database under the router
1. Establish an account with remote access to the database
two。 The local router does static route-port mapping, mapping port 3306 of the router to 3306 of the specified cloud server
3. The remote end uses the account with remote access to the database to log in through the router public network ip + 3306.
After reading this article on mysql minor problems often encountered, many readers will definitely want to know more about it. If you need more industry information, you can follow our industry information section.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.