Jump to content

[How To] Automatically create MySQL database


Dennis

Recommended Posts

In the script you send back, this was on the very first line:

LsYuvdQ.png

 

Right beneath that is the Windows code. If you go to the bottom of the document, the Linux version will be there. I've sold this very same script to a bunch of people, and they've had no problems.

The code is the same in both versions.

There is no difference.

 

Windows Version:

Create MySQL Database (replace hostinfo=%ThisService_IpHostname with hostinfo=<your MySQL server IP> if MySQL isn't installed locally):

#!/bin/bash

dbname=%ThisSexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxeId

You want to say that this version of windows ??

Edited by loadcore
Link to comment
Share on other sites

There is a difference. I've just checked. All of the variables are shown as Linux variables for Linux and Windows variables for Windows. Please check again. If you still don't believe me, I'll post a picture, or even a video of the file you just emailed back where I show you that they are different.

 

I know how this script works. I've installed it on more than 10 installations of TCAdmin, both running Linux and Windows. If you do not know how to install scripts in TCAdmin, you can buy the setup.

Link to comment
Share on other sites

There is a difference. I've just checked. All of the variables are shown as Linux variables for Linux and Windows variables for Windows. Please check again. If you still don't believe me, I'll post a picture, or even a video of the file you just emailed back where I show you that they are different.

 

I know how this script works. I've installed it on more than 10 installations of TCAdmin, both running Linux and Windows. If you do not know how to install scripts in TCAdmin, you can buy the setup.

#!/bin/bash

Why in the version of windows?

 

Then write instructions on how to connect the script.

Edited by loadcore
Link to comment
Share on other sites

So people know it's a bash script. It does nothing if used on Windows, so you can remove it if you want to.

 

You install the scripts to every game you want your clients to be able to create databases for. Then you save that script. You can choose to execute it on a custom action, like we do, but you can also choose any other event.

 

But those errors you've shown me just indicates that MySQL is not installed as a service. You need to point MySQL towards the MySQL location in the script. Just like this:

 

"Path_to_your_bin_folder\mysql.exe" -h localhost -u root -pYour_Root_Pass -e "CREATE USER '%ThisUser_UserName%'@'%%'"

 

The above example is taken from another script.

Link to comment
Share on other sites

So people know it's a bash script. It does nothing if used on Windows, so you can remove it if you want to.

 

You install the scripts to every game you want your clients to be able to create databases for. Then you save that script. You can choose to execute it on a custom action, like we do, but you can also choose any other event.

 

But those errors you've shown me just indicates that MySQL is not installed as a service. You need to point MySQL towards the MySQL location in the script. Just like this:

 

"Path_to_your_bin_folder\mysql.exe" -h localhost -u root -pYour_Root_Pass -e "CREATE USER '%ThisUser_UserName%'@'%%'"

 

The above example is taken from another script.

mysql every word in your script to replace the path to the database?

I wrote to you on the e-mail where the base is located, you could fix the script would be grateful.

Link to comment
Share on other sites

There's nothing to fix. However, I've replaced all mysql commands with the default path to mysql.exe and emailed it back to you.

 

If you've installed it somewhere else, you'll need to change the script a bit.

 

Thank you. Now the script has a nice view, and most importantly understandable.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Who's Online   0 Members, 0 Anonymous, 174 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use