In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Below I will give you a brief talk about what MySQL must know the basic commands, you know before the related similar topic content? If you are interested, take a look at this article together. I believe that after reading which MySQL basic commands will be helpful to everyone.
1.1 Log in to the database.
mysql -uroot -poldboy123 -S /data/3306/mysql.sock
1.2 View the database version and what the current logged-in user is.
select version();select user();
1.3 Create a database oldboy of GBK character sets and view the complete statements of the library.
create database oldboy character set gbk collate gbk_chinese_ci;show create database oldboy\G
1.4 Create user oldboy to manage database oldboy.
grant all on oldboy.* to 'oldboy'@'localhost' identified by 'oldboy123';
1.5 See what permissions the created user oldboy has.
show grants for oldboy@localhost\G
1.6 See which users are currently in the database.
select user,host from mysql.user;
1.7 Create admin account admin
grant all on *.* to 'admin'@'localhost' identified by 'admin123' with grant option;
1.8 Enter the oldboy database
use oldboy;
1.9 Create test table: innodb engine, character set GBK, field id int(4) and name varchar(16), view table structure and SQL statement.
create table test (id int(4),name varchar(16))ENGINE=innodb DEFAULT CHARSET=gbk;desc test; #1;
1.13 Change the name oldboy with data id equal to 1 to oldgirl.
update test set name='oldgirl' where id=1;
1.14 Insert an age field of type tinyint(2) before the field name.
alter table test add name tinyint(2) after id;
1.15 Backup oldboy and mysql libraries.
mysqldump -uroot -poldboy123 -S /data/3306/mysql.sock --events -B oldboy mysql >/opt/bak_$(date +%F).sql
egrep -v "#|^$|--|\/" /opt/bak_2017-06-06-13:36:37.sql
1.16 Delete all data from the table and view it.
truncate table test; #
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.