In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Connect to remote linux database mysql-hIP-u username-p password
[root@localhost liuzhen] # mysql-h292.168.1.180-uroot-p123456
List what databases are available
Mysql > show databases
Create database create database xxx database name
Mysql > create database lmcmsv4.0
Toggle database use xxx database name
Mysql > use lmcmsv4.0
List all tables in the database
Mysql > show tables
Backup database
Mysqldump-hIP-u user name-p password database name > backup path
Mysqldump-h292.168.1.180-uroot-p123456 lmcms_160718 > / usr/local/119_sql_bak_liuzhen/119_lmcms_160718.2016-7-31.bak
Import database
The first way: mysql-hIP-u user name-p password database
< 备份地址 [root@localhost liuzhen]# mysql -h292.168.1.180 -uroot -p123456 lmcmsv4.0 < lmcmsv4.0.sql 第二种方式:source 备份地址 查看表结构 show create table cms_user; 授权 例1、增加一个用户user001密码为123456,让他可以在任何主机上登录,并对所有数据库有查询、插入、修改、删除的权限。首先用以root用户连入MySQL,然后键入以下命令: mysql>Grant select,insert,update,delete on *. * to user001@ "%" Identified by "123456"
Example 2. Add a user's user002 password of 123456, so that this user can only log in on localhost, or set a specified IP, and query, insert, modify and delete the database test (localhost refers to the local host, that is, the host where the MySQL database is located).
In this way, even if the user knows the password of user_2, he cannot access the database directly from the Internet, and can only operate the test library through the MYSQL host.
First use the root user to connect to MySQL, and then type the following command:
Mysql > grant select,insert,update,delete on test.* to user002@localhost identified by "123456"
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.