First, create a file directory.
Mkdir myfile
VI: Create and modify a fileVI delradiusdata
CopyCodeThe Code is as follows: VI is a common tool used to create and edit files in Linux. The startweblogic. Sh script has been created below as an
The MySQL command under fedora is described in detail first. I am also just learning mysql. If something is wrong, please correct me and hope that I can help you with some experience. The following describes my installation:
1. My operating
Edit the my. cnf or my. ini file and remove the comments of the following lines of code:
Copy codeThe Code is as follows: log_slow_queries =/var/log/mysql/mysql-slow.log.
Long_query_time = 2
Log-queries-not-using-indexes
This will record slow
When creating a table, we will inevitably consider the disadvantages of weeks. Therefore, we need to use the alter table statement to modify the table later.
Modify Table Name
Copy codeThe Code is as follows: mysql> alter table student rename
To operate a table, you must first select a database because the table exists in the database.
Select Database
Mysql> use school;
Database changed
After selecting the database, we can create tables in this database.
Create a table
Mysql> create
Find the installation location of your mysql database, as shown below:C: \ Program Files \ MySQL Server 5.1, which contains the my. ini file. Find the following lines:[Mysqld]
Copy codeThe Code is as follows: # the TCP/IP Port The MySQL Server will
Query data for the current week
SELECT name, submittime FROM enterprise where yearweek (date_format (submittime, '% Y-% m-% D') = YEARWEEK (now ());
Query last week's dataSELECT name, submittime FROM enterprise where yearweek (date_format
There are three solutions to this problem:
1. Increase the value of the wait_timeout attribute of MySQL.
Modify the/etc/mysql/my. cnf file and set it in [mysqld:
# Set a connection to wait 8 hours in idle status.Wait_timeout = 86400Related
MYSQL date comparison
TO_DAYS (NOW ()-TO_DAYS (date_col) Our date_col must be in the date and time format, not the timestamp,
Mysql> SELECT FROM_UNIXTIME (875996580 );-> '2017-10-04 22:23:00'
Day (FROM_UNIXTIME (1277709862) returns the number
During the development process, you cannot avoid spam or a series of problems caused by spam. Garbled characters are the cause of character sets. They generally do not have much to do with the logic. That is to say, there is no problem in the
Install openstack folsom today. After installing mysql and adding corresponding databases and users to various services, you will find that
You cannot use the new user to log on to mysql. The method for adding users is as follows:
Mysql-uroot-p $
There are two main methods to process MYSQL transactions.
1. Use begin, rollback, and commit to implement
Start a transaction
Rollback transaction rollback
Commit transaction validation
2. directly use set to change the mysql automatic submission
Change the Data Type of a column
[SQL]
Alter table visitor MODIFY nam VARCHAR (30 );
Append a new column
[SQL]
Alter table visitor ADD age INT;
Alter table visitor ADD age int first;
Alter table visitor ADD age int after nam;
Change column
On Weibo, we will discuss how MySQL can reduce MySQL hang time When deleting a large table engine = innodb (30G +). Here is a brief summary:
When buffer_pool is large (30 GB +), because the table is deleted, the entire buffer pool will be
ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server www.2cto.com
Cause:Mysql only has one root user. After changing the root password, select MD5. After submission, click"Host 'localhost' is not allowed to connect
Directory
Mysqladmin command
UPDATE user statement
Set password statement
Root Password loss (to be verified)
Mysqladmin command
(Back to directory)
The format is as follows (USER is the USER name and PASSWORD is the new PASSWORD ):
Mysqladmin-u
1
How to implement the following SQL query in MySQL
(Select s. Name
From student s, TRANSCRIPT T
Where s. StudId = T. StudId and t. CrsCode = 'cs305 ')
INTERSECT
(Select s. Name
From student s, TRANSCRIPT T
Where s. StudId = T. StudId and t. CrsCode
The index field is too long,
1. Modify the Field Length
2. Modify the default storage engine of mysql.
Add default-storage-engine = INNODB under [mysqld] of/etc/mysql/my. cnf
However, the INNODB engine must be used for database creation.
SQL
Create two user tables, user and user2. The table structure is the same, but the user table uses the InnoDB Storage engine, while the user2 table uses the MyISAM storage engine.
Copy codeThe Code is as follows: -- Table "user" DDL
Create table 'user
The Default value of timestamp is Default CURRENT_TIMESTAMP.
The timestamp is set to automatically update on update CURRENT_TIMESTAMP as the table changes.
HoweverA table can have at most one field set CURRENT_TIMESTAMPYou cannot set DEFAULT
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service