SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 03/02/2017, 12:34 PM   #1
Ahmed21
Big Clucker
 
Join Date: Jul 2016
Posts: 158
Reputation: 3
Default MySQL help

Hello everyone,

I've run my gamemode, I've scripted it like two years ago, it uses the include file "mysql" (not a_mysql), and the plugin mysql.dll

When I run the server on my localhost, it says: Access denied for 'root'@'localhost' ....

Here's OnGameModeInit callback:

PHP Code:
public OnGameModeInit()
{
    
connection mysql_init(LOG_ONLY_ERRORS1);
    
     
mysql_connect("localhost""root""""cnr"connection1);
     return 
1;

Ahmed21 is offline   Reply With Quote
Old 03/02/2017, 01:24 PM   #2
ISmokezU
Gangsta
 
Join Date: Aug 2016
Posts: 542
Reputation: 75
Default Re: MySQL help

Code:
 mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DATABASE, MYSQL_PASSWORD);
Something like that, ( http://forum.sa-mp.com/showthread.php?t=574714 )
ISmokezU is offline   Reply With Quote
Old 03/02/2017, 02:08 PM   #3
Private200
High-roller
 
Private200's Avatar
 
Join Date: May 2012
Posts: 1,176
Reputation: 211
Default Re: MySQL help

The "" in your function is the password. If your access is being denied, it means that there is a password preventing you from entering the database. The password has to be user's password, in your case, root's password.
Private200 is offline   Reply With Quote
Old 04/02/2017, 03:13 AM   #4
JesterlJoker
Huge Clucker
 
Join Date: Apr 2015
Location: Cagayan de Oro, Philippines
Posts: 280
Reputation: 31
Default Re: MySQL help

try this
PHP Code:
public OnGameModeInit() 

    
connection mysql_init(LOG_ONLY_ERRORS1); 
     
     
mysql_connect("localhost""root""cnr""",  connection1); 
     return 
1

it's still using the a_mysql just renamed since the functions look the same. Well

just try that

if you are not using a localhost on your local computer such WAMPserver or XAMPP

then try asking your remote mysql host to tell you what the password is.
__________________

Testers are welcome just slide into my DM's.
JesterlJoker is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket Emre__ Scripting Help 10 30/07/2014 08:26 AM
[Tutorial] [VIDEO] MySQL ORM r38: How to pair GM with MySQL & creation of registration/connection system cArnasLT Tutorials 3 19/05/2014 02:08 PM
BlueG MySQL plugin - Failed (plugins/mysql.so: undefined symbol: _Z13stringvprintfPKcPc) linuxthefish Plugin Development 10 13/07/2013 10:56 AM
[Tool/Web/Other] MySQL DB Manager - Easily manage your MySQL databases with this remote application fiki574 Tools and Files 13 22/07/2012 09:41 AM


All times are GMT. The time now is 05:54 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.