SA-MP Forums Archive
Mysql Error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mysql Error (/showthread.php?tid=662476)



Mysql Error - JohnRastion - 02.01.2019

Hello, I'm running my rp script in debian host, it's based on mysql, but when i try to login , i can't spawn, i tried to re install my mysql plugins but nothing changed.
Here is my mysql errors logs:
PHP код:
[18:41:40] [ERRORCMySQLConnection::Connect - (error #1044) Access denied for user 'TIM'@'%' to database 'shoutcast'
[18:41:40] [ERRORCMySQLConnection::Connect - (error #1044) Access denied for user 'TIM'@'%' to database 'shoutcast'
[18:41:40] [ERRORCMySQLConnection::Connect - (error #1044) Access denied for user 'TIM'@'%' to database 'shoutcast'
[18:41:40] [ERRORCMySQLConnection::Connect - (error #1044) Access denied for user 'TIM'@'%' to database 'shoutcast'
[18:42:15] [ERRORCMySQLQuery::Execute[OnQueryFinished] - (error #1364) Field 'customtitle' doesn't have a default value 



Re: Mysql Error - Heress - 02.01.2019

Go to the phpmyadmin and give access connect to database for your user


Re: Mysql Error - JohnRastion - 02.01.2019

Quote:
Originally Posted by Heress
Посмотреть сообщение
Go to the phpmyadmin and give access connect to database for your user
Hello i'm glad cause you replied, do i need admin permission or just user to do that.?


Re: Mysql Error - Heress - 02.01.2019

https://imgur.com/a/noVPkvJ
go there and for your user give "ALL PRIVILEGIES"


Re: Mysql Error - JohnRastion - 02.01.2019

Quote:
Originally Posted by Heress
Посмотреть сообщение
https://imgur.com/a/noVPkvJ
go there and for your user give "ALL PRIVILEGIES"
I think all privileges are given :
PHP код:
privileges :    ALL 



Re: Mysql Error - JohnRastion - 02.01.2019

Quote:
Originally Posted by ******
Посмотреть сообщение
Do not give them `ALL PRIVILEGES`! That's a perfect way to introduce security issues. Most users should be restricted to `INSERT`, `UPDATE`, and `SELECT`. Some may need `DELETE`, but if you write carefully you shouldn't need that either. The other privileges are related to DB and table management, which you should just do once outside your mode (create the tables etc), then not need access to from inside the mode.
and what's methode to fix that problem


Re: Mysql Error - RoboN1X - 03.01.2019

Quote:
Originally Posted by JohnRastion
Посмотреть сообщение
and what's methode to fix that problem
Uncheck "All Privileges" and check only necessary ones.
https://dev.mysql.com/doc/refman/5.7...-provided.html

You can apply it for specific user, or for specific database

If you are using phpMyAdmin: Enter as your root/admin database user (user that have privilege to change or grant another user's privilege), Click on the database, select "Privileges" tab, click "Edit User Privileges" next to the user name in the list.
But if you want to change the privileges globally (all database), click home icon, click users, then click "edit user privileges" next to the user name in the list.

Note: It's recommended to set your database privileges per user per application only, example for "samp_server" user, you block everything from other database, and only allow your sa-mp server database, with selected privileges as ****** suggested, or to be actual, what the script needs. It is just to minimize the risk in case your database/user is hacked.