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

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

CheatAsylum
  • Winter 2020
Status: Offline
Joined: Feb 13, 20186Year Member
Posts: 330
Reputation Power: 272
Status: Offline
Joined: Feb 13, 20186Year Member
Posts: 330
Reputation Power: 272
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, 201212Year Member
Posts: 20,271
Reputation Power: 17066
Motto: 2b || !2b
Motto: 2b || !2b
Status: Offline
Joined: Jan 16, 201212Year Member
Posts: 20,271
Reputation Power: 17066
Motto: 2b || !2b
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:
CheatAsylum
  • Ladder Climber
Status: Offline
Joined: Feb 13, 20186Year Member
Posts: 330
Reputation Power: 272
Status: Offline
Joined: Feb 13, 20186Year Member
Posts: 330
Reputation Power: 272
Craig wrote 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.


How would I go about that? I'm a noob in terms of this stuff, but slowly learning.
#4. Posted:
Craig
  • Discord Elite
Status: Offline
Joined: Jan 16, 201212Year Member
Posts: 20,271
Reputation Power: 17066
Motto: 2b || !2b
Motto: 2b || !2b
Status: Offline
Joined: Jan 16, 201212Year Member
Posts: 20,271
Reputation Power: 17066
Motto: 2b || !2b
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:
CheatAsylum
  • Blind Luck
Status: Offline
Joined: Feb 13, 20186Year Member
Posts: 330
Reputation Power: 272
Status: Offline
Joined: Feb 13, 20186Year Member
Posts: 330
Reputation Power: 272
Craig wrote 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


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
  • The Robin
Status: Offline
Joined: Jan 16, 201212Year Member
Posts: 20,271
Reputation Power: 17066
Motto: 2b || !2b
Motto: 2b || !2b
Status: Offline
Joined: Jan 16, 201212Year Member
Posts: 20,271
Reputation Power: 17066
Motto: 2b || !2b
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:
CheatAsylum
  • Fairy Master
Status: Offline
Joined: Feb 13, 20186Year Member
Posts: 330
Reputation Power: 272
Status: Offline
Joined: Feb 13, 20186Year Member
Posts: 330
Reputation Power: 272
Craig wrote 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.


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
  • Resident Elite
Status: Offline
Joined: Aug 13, 20159Year Member
Posts: 227
Reputation Power: 20
Status: Offline
Joined: Aug 13, 20159Year Member
Posts: 227
Reputation Power: 20
You can not have a default value
#9. Posted:
CheatAsylum
  • Ladder Climber
Status: Offline
Joined: Feb 13, 20186Year Member
Posts: 330
Reputation Power: 272
Status: Offline
Joined: Feb 13, 20186Year Member
Posts: 330
Reputation Power: 272
Never mind, I'm a complete bot. Thank you so much Craig! I truly, truly appreciate the help!
#10. Posted:
Craig
  • Winter 2021
Status: Offline
Joined: Jan 16, 201212Year Member
Posts: 20,271
Reputation Power: 17066
Motto: 2b || !2b
Motto: 2b || !2b
Status: Offline
Joined: Jan 16, 201212Year Member
Posts: 20,271
Reputation Power: 17066
Motto: 2b || !2b
Users browsing this topic: None
Jump to:


RECENT POSTS

HOT TOPICS