• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

Auto Startup MySql error

Started by bejohn, July 26, 2014, 02:01:59 AM

bejohn

Hello all,

Here is the problem I am having.
When the computer reboots I get the error that Radiodj can't connect to the mysql server (mysql is on the same computer)

What is happening is that RadoDj is starting before the MySql server is loaded and running.

How can I make Radiodj delay on system startup?

I'm using XP Pro SP3.

Thanks for the help.
John

AndyDeGroo

It depends on how your MySQL is started. If it runs as a windows service, as it should be, it should be running by the time you get to start RadioDJ.
It shouldn't be possible for RadioDJ to start before MySQL service even if RDJ is started automatically after user logs on.

DJones

Before you bother to delay starting RadioDJ, which is doable, how is MySQL installed? Standalone? Guessing not since that would normally run as a service so it would be loaded before you ever login to WinXP. Using WAMP? Let us know and we can give you better advice.

Regardless, I'd suggest using MariaDB instead.

bejohn

Hello and thanks for the reply's.

It's a windows service.
I used "mysql-installer-web-community-5.6.19.0" and its a service in windows and I think the install was a Standalone server.
I can see it in the services and control it from there.

Now if I let windows load then run RadioDj I have no issues I just can't let it auto start on boot.

I did try a startup bat in my startup folder with this..

TIMEOUT /T 50
REM Total Delay = 50 seconds
START "" "C:\RadioDJ\RadioDJ.exe"

But xp does not have the timout command

and this ping trick..
ping 192.168.0.8 -n 1 -w 123 >nul
START "" "C:\RadioDJ\RadioDJ.exe"

but that was not enough time to load.

Not sure why it's taking so long for MySql to load.

Thanks again for the help.

[attachment deleted by admin]

AndyDeGroo

Why bother with some arcane batch files? Just drop a shortcut to RadioDJ in "%userprofile%\Start Menu\Programs\Startup" and it should start right after user profile has loaded. Point and click directions can be found here (works same on XP).
That way you can completely avoid the race condition.

bejohn

Quote from: AndyDeGroo on July 26, 2014, 05:03:08 PM
Why bother with some arcane batch files? Just drop a shortcut to RadioDJ in "%userprofile%\Start Menu\Programs\Startup" and it should start right after user profile has loaded. Point and click directions can be found here (works same on XP).
That way you can completely avoid the race condition.

I tried that but will not run and I get the error.

AndyDeGroo

"the error" is not descriptive enough and I don't remember where I put my crystal ball.
It seem that you are having some strange issues with your MySQL installation. Normally it should be up and running in about 5-15 seconds and it takes way more time to load user profile and settings on XP.
Please check Windows event viewer for MySQL related startup errors.

If you can't fix it, you should back up your data and migrate to MariaDB.

bejohn

Here is what I have in my Application Events.

7/26/2014 1:31:59 PM MySQL Information None 100 N/A AIR C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld: ready for connections.
Version: '5.6.19'  socket: ''  port: 3306  MySQL Community Server (GPL)

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:59 PM MySQL Information None 100 N/A AIR Event Scheduler: Loaded 0 events

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:59 PM MySQL Information None 100 N/A AIR Server socket created on IP: '127.0.0.1'.

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:59 PM MySQL Information None 100 N/A AIR   - '127.0.0.1' resolves to '127.0.0.1';

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:59 PM MySQL Information None 100 N/A AIR Server hostname (bind-address): '127.0.0.1'; port: 3306

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:59 PM MySQL Information None 100 N/A AIR InnoDB: 5.6.19 started; log sequence number 1626273

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:59 PM MySQL Information None 100 N/A AIR InnoDB: Waiting for purge to start

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:59 PM MySQL Information None 100 N/A AIR InnoDB: 128 rollback segment(s) are active.

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:59 PM MySQL Information None 100 N/A AIR InnoDB: Highest supported file format is Barracuda.

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:59 PM MySQL Information None 100 N/A AIR InnoDB: Completed initialization of buffer pool

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:59 PM MySQL Information None 100 N/A AIR InnoDB: Initializing buffer pool, size = 56.0M

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:58 PM MySQL Information None 100 N/A AIR InnoDB: Not using CPU crc32 instructions

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:58 PM MySQL Information None 100 N/A AIR InnoDB: Compressed tables use zlib 1.2.3

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:58 PM MySQL Information None 100 N/A AIR InnoDB: Mutexes and rw_locks use Windows interlocked functions

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:58 PM MySQL Information None 100 N/A AIR InnoDB: The InnoDB memory heap is disabled

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:58 PM MySQL Information None 100 N/A AIR InnoDB: Using atomics to ref count buffer pool pages

For more information, see Help and Support Center at http://www.mysql.com. 
7/26/2014 1:31:58 PM MySQL Information None 100 N/A AIR Plugin 'FEDERATED' is disabled.

AndyDeGroo

There is nothing out of ordinary in those log entries. As you can see, it takes about two seconds for MySQL to start up.
To see if RadioDj is really starting before MySQL, you should see if RadioDJ messages appear before MySQL. Although, I can't understand how on earth is that even possible.
If you really need RadioDJ to run on logon, you can use shceduled tasks with logon trigger and add a delay as a last resort. I can't recall if scheduled tasks on XP had the delay option in triggers, but it should be in "Edit Trigger" window.

bejohn

Ok well I gave up on that box since I got a faster one.
I went with MariaDB and the setup was smooth.

Everything moved over and runs great with less processing being used.

Only problem I am having now is having PHP access the DB.
Worked on the old DB but not this one.
I get "Client does not support authentication protocol requested by server; consider upgrading MariaDB client"
I have the new stable version.

Oh well I will have to play with it later.

But thanks for all of the help.

John

AndyDeGroo

Good to know that you've solved most of the issues.

Quote from: bejohn on July 31, 2014, 03:47:44 AM
Only problem I am having now is having PHP access the DB.
Worked on the old DB but not this one.
I get "Client does not support authentication protocol requested by server; consider upgrading MariaDB client"
I have the new stable version.
Although, this asks for a new topic, here are two main questions:
1. What is the version number of "new stable version" and what OS?
2. Are you using libmysql from MariaDB?

You must be using php_mysql extension. You should enable php_mysqli and ditch the depreciated and buggy php_mysql.
You might have to rewrite demo scripts for mysqli if you are using them. I can provide a working example, if you need it.

bejohn

1. MatiaDB 10.0.12 Win64 on Windows 7 64bit
2. Not sure where to find libmysql in MatiaDB.

The Demo script is what I am having problems connecting with inside and outside my network.

Thanks
John

AndyDeGroo

Sorry, my questions weren't clear enough.
1. I meant the PHP version.
2. Also, the libmysql for PHP, but that's irrelevant on Windows.

You should be ok with php_mysqli enabled, if you have PHP 5.5 or later.
Demo scripts will still have to be rewritten for mysqli_* functions.

bejohn

It's FreeBSD 4.10 at the datacenter and I can't change the system.

PHP Version 4.3.6 on Apache 1.3.29
MySQL 4.0.18

Ask to have it upgraded sometime before but they can't. It's provided to me free of charge so I can't do too much complaining.

I had the scripts running on this server before I switched from mySQL to the MatiaDB.
I was thinking it was permissions but they are all set correctly.

Would be nice to use some of the demo script but if it's not going to work then I will have to live with it.
I don't want to run it locally and have it in a iframe or anything like that.

Thanks for all your help.

AndyDeGroo

Quote from: bejohn on July 31, 2014, 05:21:49 PM
It's FreeBSD 4.10 at the datacenter and I can't change the system.

PHP Version 4.3.6 on Apache 1.3.29
MySQL 4.0.18
There's your problem. The PHP version is obsolete and it is using old version of MySQL library. Hence the error message about incompatible protocol versions.
You should consider a different hosing provider. Consider that FreeBSD 4.10 was released in May 2004. That's more than ten years ago.
I know from experience that upgrading packages on BSD systems can be a pain. If not managed properly, BSD can fall behind on upgrades and become obsolete rather fast.