Wednesday, 16 November 2016

restart MySQL Server on MacOSX after Sierra Upgrade

After each upgrade of MacOS X, MySQL won't restart, as the upgrade process delete the logging directory of MySQL :


If you try to run mysqld_safe manually, you'll get cristal clear error :

[10:45] tmanson@busyboxy:/usr/local/mysql/bin$ ./mysqld_safe
./mysqld_safe: line 544: /usr/local/mysql/data/mysqld_safe.pid: Permission denied
awk: i/o error occurred while closing /dev/stdout
 input record number 3, file
 source line number 1
161116 10:46:07 mysqld_safe Logging to '/var/log/mysql/error.log'.
touch: /var/log/mysql/error.log: No such file or directory
chmod: /var/log/mysql/error.log: No such file or directory
161116 10:46:07 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
./mysqld_safe: line 129: /var/log/mysql/error.log: No such file or directory
./mysqld_safe: line 166: /var/log/mysql/error.log: No such file or directory
touch: /var/log/mysql/error.log: No such file or directory
chown: /var/log/mysql/error.log: No such file or directory
chmod: /var/log/mysql/error.log: No such file or directory
161116 10:46:07 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
./mysqld_safe: line 129: /var/log/mysql/error.log: No such file or directory


(note: the error about mysql_safe.pid is just here because I've launch mysqld_safe as my regular user instead of root, but the path exists and the mysql tool that starts mysql is starting it as root)

To solve this :

sudo mkdir /var/log/mysql/
sudo chown _mysql:admin /var/log/mysql/

normally, MySQL is tried to start periodically, so you actually don't need to startit manually!
so you should just check, in the system preference/mysql :



Friday, 30 September 2016

Stellaris and AZERTY Keyboard




Paradox Interactive did a great job with Stellaris Game, as you may read on internet.
So I did spent 40€ for the game, and I was unpleasantly surprised that AZERTY Keyboard are not supported... WTF in 2016 !!! In 1995 we had configurable key binding and probably before that... (Can't remember).

I've search a bit and couldn't find an Out Of The Box solution, so here is a step by step instruction.

  1. Go to the AutoHotkey Homepage. https://autohotkey.com/
  2. Click Download. https://autohotkey.com/download/ahk-install.exe
  3. Run akh-install.exe to install AutoHotkey
  4. Right click on your desktop, New, "AutoHotkey", name it "Stellaris AZERTY.ahk"
  5. Copy paste the script below : 
     #SingleInstance Force  
     #MaxHotkeysPerInterval 99999  
     ;start game  
     Run, "steam://rungameid/281990"  
     ;"fix" keys  
     ;#IfWinActive ahk_class stellaris  
     ;#Persistent  
     ;#UseHook  
     z::w  
     w::z  
     a::q  
     q::a  
    
  6. Save
  7. Right click on the .ahk file and click "Compile".
    This will create an executable file of the name of the script, that will run Stellaris.
  8. Launch "Stellaris azerty key bindings.exe" to launch the game in AZERTY mode

Note :
  • Run, "steam://rungameid/281990" :  to get this, you just need to right click, properties on the Stellaris shortcut from Steam.
  • IfWinActive, uncommenting and setting the proper keyword (like Stellaris) would limit the keybinding to the Stellaris game.
    With this commented, the keybinding are changed for the whole system, and you have to kill the "Stellaris azerty key bindings.exe" process to revert back.
    I'll test later, for now, I want to play ;)
  • It only change zqwa keys for now, I'll update the script if more is needed