PC SupportQuick SQL issue, perhaps somebody could help?Posted:

Winja
  • Challenger
Status: Online
Joined: Feb 13, 20182 Year Member
Posts: 152
Reputation Power: 8
Hey guys! So, I'm working on a FiveM server and whenever I import this SQL I get this error:
gyazo.com/b5376ea72bd931e6f6ca41ac057e7542 - The database is hosted off a Linux VPS.

However, when I run the SQL on my test server which uses XAMPP on my local host it goes through without issues. It's causing a lot of hassle not sure on how to go about fixing it. Any help would be truly, truly appreciated.
#2. Posted:
Craig
  • TTG Veteran
Status: Offline
Joined: Jan 16, 20128 Year Member
Posts: 20,087
Reputation Power: 13700
Motto: 2b || !2b - That is the real question!
Looks to me like the transactions field is looking for text but has the default of 0 which isn't usually possible on default setups, if you require the default of 0 in that field you could disable Strict mode which should then allow the default to be set regardless.
#3. Posted:
Winja
  • Challenger
Status: Online
Joined: Feb 13, 20182 Year Member
Posts: 152
Reputation Power: 8
Craig wroteLooks to me like the transactions field is looking for text but has the default of 0 which isn't usually possible on default setups, if you require the default of 0 in that field you could disable Strict mode which should then allow the default to be set regardless.


How would I go about that? I'm a noob in terms of this stuff, but slowly learning.
#4. Posted:
Craig
  • TTG Veteran
Status: Offline
Joined: Jan 16, 20128 Year Member
Posts: 20,087
Reputation Power: 13700
Motto: 2b || !2b - That is the real question!
Depends on if you need the default value for transactions?

If not, you could just try amending that line to

`transactions` text NULL,

If you want to disable strict mode: stackoverflow.com/a/45612889
#5. Posted:
Winja
  • Christmas!
Status: Online
Joined: Feb 13, 20182 Year Member
Posts: 152
Reputation Power: 8
Craig wroteDepends on if you need the default value for transactions?

If not, you could just try amending that line to

`transactions` text NULL,

If you want to disable strict mode: stackoverflow.com/a/45612889


Hey dude, sorry to bother you again. Could you shed some light on another line for me please?

I'm trying to create a user with all privileges to access the database remotely (I.E. On my desktop) however I keep getting a syntax error. I've googled it and still non the wiser.

Code is:

GRANT ALL ON *.* TO 'username'@'mylocalIP' IDENTIFIED BY 'mypassword';
#6. Posted:
Craig
  • Wizard
Status: Offline
Joined: Jan 16, 20128 Year Member
Posts: 20,087
Reputation Power: 13700
Motto: 2b || !2b - That is the real question!
Try this.

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'newpass';
CREATE USER 'newuser'@'%' IDENTIFIED BY 'newpass';



GRANT ALL ON *.* TO 'newuser'@'localhost';
GRANT ALL ON *.* TO 'newuser'@'%';
FLUSH PRIVILEGES;


Be sure that the port is remotely accessible, usually 3306.
#7. Posted:
Winja
  • Christmas!
Status: Online
Joined: Feb 13, 20182 Year Member
Posts: 152
Reputation Power: 8
Craig wroteTry this.

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'newpass';
CREATE USER 'newuser'@'%' IDENTIFIED BY 'newpass';



GRANT ALL ON *.* TO 'newuser'@'localhost';
GRANT ALL ON *.* TO 'newuser'@'%';
FLUSH PRIVILEGES;


Be sure that the port is remotely accessible, usually 3306.


Returns the error "You are not allowed to create a user with GRANT" despite me being logged in using the root account.
#8. Posted:
JoeyNap
  • V5 Launch
Status: Offline
Joined: Aug 13, 20155 Year Member
Posts: 227
Reputation Power: 20
You can not have a default value
#9. Posted:
Winja
  • Christmas!
Status: Online
Joined: Feb 13, 20182 Year Member
Posts: 152
Reputation Power: 8
Never mind, I'm a complete bot. Thank you so much Craig! I truly, truly appreciate the help!
#10. Posted:
Craig
  • Summer 2020
Status: Offline
Joined: Jan 16, 20128 Year Member
Posts: 20,087
Reputation Power: 13700
Motto: 2b || !2b - That is the real question!
Users browsing this topic: None
Jump to:


RECENT POSTS

HOT TOPICS