标签:fetchall div 命令 org check fetch 查询 class imp
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
yum -y install MariaDB
systemctl restart mysql
systemctl enable mysqld
mysql
> grant all privileges on *.* to root@‘%‘ identified by ‘root‘;
flush privileges;
> use mysql;
> select host,user,password from user;
exit
firewall-cmd --add-port=3306/tcp
firewall-cmd --add-port=3306/tcp --permanent
import pymysql
db = pymysql.connect(host="192.168.200.12",user="root",
password="root",db="mysql",port=3306)
cusor = db.cursor()
cursor.excute(‘select host,user,password from user‘) # cursor 是游标
#cursor.excute(‘create database class‘) #excute 执行
res = cursor.fetchall() #查询命令
res = cursor.fetchmany()
for result in res :
print(result)
标签:fetchall div 命令 org check fetch 查询 class imp
原文地址:https://www.cnblogs.com/t-ym/p/11826510.html