smay3411 Posted January 31, 2020 Share Posted January 31, 2020 Hi All, I am having a little trouble with my database I am using the scripts from here https://help.tcadmin.com/Automatically_Create_a_MySQL_Database everything works up to this point. with MySqlManager() as mysql2: mysql2.DisableReplication=True; mysql2.Connect(String.Format("Data Source={0};Database={1};User Id= {1};Password={2};Pooling=False;", mysql_server, ThisService.Variables["MySQLUser"], ThisService.Variables["MySQLPassword"])); mysql2.ImportDatabase(ThisService.RootDirectory + "db.sql"); this is the error I am getting. Access denied for user 'db28'@'%' to database 'db' I have tried everything to fix but no good. cheers SM Link to comment Share on other sites More sharing options...
numpty Posted February 1, 2020 Share Posted February 1, 2020 That means something is incorrect in the username password or connection ip for the original connection Link to comment Share on other sites More sharing options...
LFA Posted February 1, 2020 Share Posted February 1, 2020 Use MySQL workbench to make sure the user db28 is being created correctly. Link to comment Share on other sites More sharing options...
LFA Posted February 1, 2020 Share Posted February 1, 2020 Also if your MySQL server is on a different server modify the script to create user@% instead of user@localhost Link to comment Share on other sites More sharing options...
smay3411 Posted February 2, 2020 Author Share Posted February 2, 2020 Thanks for that I have got past that now but now having trouble creating but I will keep at it and hopefully work it out. Link to comment Share on other sites More sharing options...
smay3411 Posted February 2, 2020 Author Share Posted February 2, 2020 Hi Guys. I have everything works now but I can not import the .sql file with MySqlManager() as mysql2: mysql2.DisableReplication=True; mysql2.Connect(String.Format("Data Source={0};Database={1};User Id= {1};Password={2};Pooling=False;", mysql_server, ThisService.Variables["MySQLUser"], ThisService.Variables["MySQLPassword"])); mysql2.ImportDatabase(ThisService.RootDirectory + "db.sql"); I am using db.sql for now I have put it in the server root, after install of Dayz there is nothing in mysql (db28) table. Does anyone know how I can fix this cheers SM Link to comment Share on other sites More sharing options...
LFA Posted February 2, 2020 Share Posted February 2, 2020 Make sure the file exists. Under the ImportDatabase command add this line. Keep the spacing of the previous line. Script.WriteToConsole(mysql2.ImportDatabase(ThisService.RootDirectory + "db.sql") That should write the full path to db.sql in /home/tcadmin/Logs/Monitor/console.log. Make sure it exists. It won't fail with an error if it doesn't exist. Link to comment Share on other sites More sharing options...
smay3411 Posted February 3, 2020 Author Share Posted February 3, 2020 Hi All, Thanks LFA for pointing me in the right direction I will work it out. Cheers SM Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now