使用mysqldb创建一个新数据库 [英] creating a new database with mysqldb

查看:61
本文介绍了使用mysqldb创建一个新数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于mysqldb的connect方法需要一个数据库名称,所以似乎没有已经创建数据库就不能使用它。那么

有一种方法可以连接到你的mysql服务器(没有指定的

数据库)来创建一个新的数据库(即CREATE DATABASE

查询)?


谢谢。

Since the connect method of mysqldb requires a database name, it seems
like you can''t use it without having a database already created. So is
there a way to connect to your mysql server (without a specified
database) in order to create a new database (i.e., the CREATE DATABASE
query)?

Thanks.

推荐答案

类型:


用谷歌创建一个新数据库


进入谷歌看看会发生什么


rd


BartlebyScrivener写道:
BartlebyScrivener wrote:
类型:

用mysql创建一个新的数据库

到谷歌和看看会发生什么

rd
Type:

create a new database with mysql

into google and see what happens

rd




嗯,关于它的事情是我在网上找到的所有指南似乎都是

开始使用命令提示符或unix shell,在我的情况下,两者都不会起作用。我正在尝试使用python脚本找到一种方法来访问我的数据库服务器

。也许这对我来说甚至不可能在没有shell访问的情况下获得
。我可能只需要在我的服务器控制面板中使用msqladministrator

,而不是使用python。



Well, the thing about it is that all the guides I find online seem to
begin with using a command prompt or a unix shell, neither of which will
work in my case. I''m trying to find a way to access my database server
using just a python script. Perhaps that isn''t even possible for me to
do without shell access. I might just have to use the msqladministrator
in my server control panel, instead of using python.


John Salerno写道:
John Salerno wrote:
由于mysqldb的connect方法需要一个数据库名称,所以似乎没有数据库已经创建就无法使用它。那么有没有办法连接到你的mysql服务器(没有指定的数据库)来创建一个新的数据库(即CREATE DATABASE
查询)?
<谢谢。
Since the connect method of mysqldb requires a database name, it seems
like you can''t use it without having a database already created. So is
there a way to connect to your mysql server (without a specified
database) in order to create a new database (i.e., the CREATE DATABASE
query)?

Thanks.




我不是专家但是:你不能用脚本/方案生成mysql吗?


Philippe



I''m no expert but: can''t you spawn mysql with a script/scheme ?

Philippe


这篇关于使用mysqldb创建一个新数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆