如何恢复在 MySQL 中创建新数据库的权限?
我无法使用MySQL。 MySQL 在我的本地计算机上。目前,我在 My.ini 中添加了 skip-grant-tables
,以便我可以使用 MySQL。但我没有权限创建新数据库。我的问题很棘手,虽然我在SO上问了相关问题,但没有答案可以解决我的问题。我几乎要放弃了。所以我降低了我的期望。我正在开发一个网站,所以需要创建数据库、表并操作表。您不必考虑安全性。是否有一个简单的解决方案可以赋予我创建新数据库的权限?也许通过在 my.ini 中添加一些命令或者其他什么?你不需要完全解决我的问题。也许开发完成后,我会将数据库和表上传到另一台服务器(当前数据库服务器是我的个人电脑,Windows XP),以便我可以卸载并重新安装MySQL。
问题的根源是我缺乏特权。
I can not use MySQL. MySQL is on my local computer. Currently I added skip-grant-tables
in My.ini so I can use MySQL. But I have no privilege to create a new database. My problem is tough, although I asked related questions on SO, but no answer can resolve my problem. I almost give up. So I lower my expectation. I am developing a website, so I need to create database, tables and operate tables. You don't have to consider security. Is there a simple solution that can give me privilege to create a new database? Maybe by adding some command in my.ini or something? You won't need to completely resolve my problem. Maybe after the development, I will upload the database and tables to another server(The current database server is my personal computer, windows XP) so I can uninstall and reinstall MySQL.
The root of problem is that I lack privileges.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不确定这是否适合您,因为您可能首先需要拥有更高的权限,但值得一试。
应该有一个名为
mysql
的数据库。看看那里,您会看到一个名为users
的表。对于每条记录,都有一堆名为Select_priv
、Insert_priv
等的列。对于您的用户记录,请将其中每一个更改为“Y”。I'm not sure if this will work for you, since you might need to have elevated privileges in the first place, but it's worth a shot.
There should be a database called
mysql
. Take a look in there, and you'll see a table calledusers
. For each record, there's a heap of columns namedSelect_priv
,Insert_priv
, etc. For your user record, change each of these to "Y".听起来有点像你的安装误入歧途。
也许卸载/重新安装是您最好的选择,假设您从未能够连接,因此没有数据需要考虑。
花点时间进行安装,看看 MySQL 安装后注意事项
It sounds a bit like your installation went astray.
Maybe uninstall/resinstall is your best option, assuming that you've never been able to connect, so there is no data to consider.
Take your time on the installation, and have a look at MySQL Postinstallation Notes
关于这个具体问题,您有 4 个问题未解决。您不应打开重复项,而应仅使用新信息更新其中一个。
但解决你的问题的简单方法是从 mysql 网站下载适合你的 mysql 版本的 mysql ZIP 文件,然后将 data\mysql 文件夹复制到你的数据文件中,然后重新启动服务。这将为您提供一个具有完全访问权限的空白密码的 root 用户。
you have 4 questions open about this specific problem. instead of opening duplicates, you should instead update just one of them with new information.
but the simple solution to your problem is to download the ZIP file of mysql for your mysql version from the mysql website and just copy the data\mysql folder in to your data file, then restart the service. this will give you a root user with a blank password that has full access.