MariaDB对外开放连接:

 

CREATE USER 'root'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;

 

 编辑/etc/mysql/my.cnf

#bind-address  = 127.0.0.1

mysql查看表结构命令,如下:

desc 表名;
show columns from 表名;
describe 表名;
show create table 表名;

use information_schema
select * from columns where table_name='表名';

顺便记下:
show databases;
use 数据库名;
show tables;

创建数据库
create database abc;

 

删除数据库:

DROP DATABASE 数据库名;

 source 文件路径(注意要使用你所需要的数据库)

 

远程登陆MySQL,同时指定对应的端口和ip。

假设远程的ip为:10.154.0.43

端口为:3341

输入如下命令:

#mysql -uroot -p -h10.154.0.43 -P3341

回车后:

会需要输入密码。

开放mysql的外部访问权限

 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION

相关文章:

  • 2021-09-27
  • 2021-12-17
  • 2022-12-23
  • 2023-03-21
  • 2022-01-01
  • 2022-01-07
  • 2022-12-23
猜你喜欢
  • 2021-12-31
  • 2022-01-13
  • 2022-12-23
  • 2021-05-25
  • 2021-08-07
  • 2021-12-05
  • 2021-05-26
相关资源
相似解决方案