Jump to content
Froxlor Forum
  • 0

[HELP] Cannot create a new database


Max Amigo

Question

When I try to create a database as a customer in Froxlor, I always get an error:

A database error occurred
SQLSTATE[HY000]: General error: 1007 Can't create database 'editor1sql1'; database exists

In the database list I see nothing: Databases (0 / 0)

Any idea? :huh:

p.s. Before this error, I saw error that my DB root user doesn't have permissions on 'editor1sql1' table.

 

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

The message is pretty clear...the database already exists...seems like something manually happened here as froxlor increases the internal database-counter per customer and hence should just create sql2 ...or are you repeatingly pressing f5 and resending the form?

Link to comment
Share on other sites

  • 0

So, I deleted the manually DB 'editor1sql1' and user 'editor1sql1'@'127.0.0.1'. Then I repeated the process again and I have the initial error:

A database error occurred
SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'dbadmin'@'127.0.0.1' to database 'editor1sql1'

Error: SQLSTATE[HY000]: General error: 1007 Can't create database 'editor1sql1'; database exists

Is a cascading result of this one.

 

As a side note: I don't know much about mysql, but might it be somehow related to this??

mysql> SELECT User, Host FROM mysql.user;
+------------------+-----------------+
| User             | Host            |
+------------------+-----------------+
| dbadmin          | 127.0.0.1       |
| editor1sql1      | 127.0.0.1       |
| froxlor          | 127.0.0.1       |  <-- IP address
| froxlor          | XXX.XXX.XXX.XXX |  <-- My public IP address?
| dbadmin          | localhost       |  <-- DB root
| debian-sys-maint | localhost       |  <-- localhost
| froxlor          | localhost       |
| mysql.infoschema | localhost       |
| mysql.session    | localhost       |
| mysql.sys        | localhost       |
| root             | localhost       |
+------------------+-----------------+
11 rows in set (0.00 sec)

 

 

This is how I created my mysql users:

CREATE DATABASE froxlor;
CREATE USER 'froxlor'@'localhost' IDENTIFIED BY 'pass1';
GRANT ALL PRIVILEGES ON froxlor.* TO 'froxlor'@'localhost';
CREATE USER 'froxlor'@'127.0.0.1' IDENTIFIED BY 'pass1';
GRANT ALL PRIVILEGES ON froxlor.* TO 'froxlor'@'127.0.0.1';
FLUSH PRIVILEGES;

CREATE USER 'dbadmin'@'localhost' IDENTIFIED BY 'pass2';
GRANT ALL PRIVILEGES ON *.* TO 'dbadmin'@'localhost';
CREATE USER 'dbadmin'@'127.0.0.1' IDENTIFIED BY 'pass2';
GRANT ALL PRIVILEGES ON *.* TO 'dbadmin'@'127.0.0.1';
FLUSH PRIVILEGES;

 

Edited by Max Amigo
added more info
Link to comment
Share on other sites

  • 0
17 minutes ago, Max Amigo said:
CREATE USER 'dbadmin'@'localhost' IDENTIFIED BY 'pass2';
GRANT ALL PRIVILEGES ON *.* TO 'dbadmin'@'localhost';
CREATE USER 'dbadmin'@'127.0.0.1' IDENTIFIED BY 'pass2';
GRANT ALL PRIVILEGES ON *.* TO 'dbadmin'@'127.0.0.1';
FLUSH PRIVILEGES;

you are missing a part for the "super user":
 

GRANT ALL PRIVILEGES ON *.* TO 'dbadmin'@'localhost' WITH GRANT OPTION;

 

Link to comment
Share on other sites

  • 0
Just now, Max Amigo said:

Now it works.

Here is SQL that fixed permission issues:

GRANT ALL PRIVILEGES ON *.* TO 'dbadmin'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'dbadmin'@'127.0.0.1'WITH GRANT OPTION;
FLUSH PRIVILEGES;

 

hahaha I was a second too slow :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...