Mysql connection - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Mysql connection (
/showthread.php?tid=586525)
Mysql connection -
Fancy - 22.08.2015
I am new to mysql
How to connect my script to my database?
I have a server with IP 103.250.80.118:7777
Код:
#define host ""
#define user ""
#define db ""
#define pass ""
Re: Mysql connection -
NickMirra - 22.08.2015
Well you have to provide the mysql hostname so for example my test server is
#define host "localhost" // The SQL host, if its localhost, or whatever its hosted on.
#define user "ucp" // this is the user your mysql account is using.
#define db "root" // this is the name of your database itself.
#define pass "" // Leave Empty if your user has no password.
Re: Mysql connection -
Fancy - 22.08.2015
i want to know that i will add the server ip(without port) here?:
Код:
#define host "localhost"
Re: Mysql connection -
rymax99 - 22.08.2015
The defines just hold the IP/host/DB/password, they're not even needed. You're going to have to use a MySQL plugin if you want to save data using MySQL in your script.
Re: Mysql connection -
Fancy - 22.08.2015
how will i make an account in phpmyadmin?
Re: Mysql connection -
rymax99 - 22.08.2015
Quote:
Originally Posted by Fancy
how will i make an account in phpmyadmin?
|
What? phpMyAdmin is a front-end database manager, you can use it to manipulate MySQL databases. Keep in mind, SQL - Structured Query
Language is a separate language from PAWN and you should learn it before trying to use it within PAWN.
http://www.w3schools.com/sql/
Re: Mysql connection -
Fancy - 22.08.2015
Quote:
Originally Posted by rymax99
What? phpMyAdmin is a front-end database manager, you can use it to manipulate MySQL databases. Keep in mind, SQL - Structured Query Language is a separate language from PAWN and you should learn it before trying to use it within PAWN.
http://www.w3schools.com/sql/
|
i mean what will be the username and pass in phpmyadmin?
Re: Mysql connection -
Jake187 - 22.08.2015
These type of questions you are asking are OS based not server based. If you need help with mySQL / phpmyadmin you should go to a software help forum such as a linux help forum which more supporters can help provide you with answers faster and easier.
Anyways to answer your question you create a mysql user and password normally via command line such as
CREATE USER 'serveruser'@'localhost' IDENTIFIED BY 'password';
This means you would login to phpmyadmin with username: serveruser and password: password
You of course would need to link the database and so forth, if you want to learn how to add mysql users and create databases please ****** it there is hundreds of tutorials.