Critical Patch for Ubuntu 16 and Mysql 5.7.x servers
Posted: Tue Nov 29, 2016 1:42 pm
Hi
As always I say sorry for my bad english and a lot of mistakes in my write.
If you use ubuntu 16.04 or use mysql 5.7 whit vestacp I strongly recomended you apply this temporary patch until vesta team deploy official one.
Why this is critital if all working fine ?
Vesta fail when store mysql password into user/db.conf on mysql 5.7+ so you can create 100 databases / users today and tomorrow whant transfer to orther server or just backup it, whit default install your password not get saved
This work only whit mysql 5.7.6+ earlier versions of 5.7 like 5.7.5 may not work.
The problem cause this 3 bad problems:
1- Your password not stored in user/db.conf so when you make a databases backup you not backup your actual mysql user password.
2- If you not backup you cant restore it in your server or in others servers.
3- Also fail rabuild function when you try restore mysql database from orther server whit correct db.conf it cant restore it because rebuild function isnt prepared for mysql 5.7
So you can apply patch :
Login in your server as root->
##########
# backup db. sh and rebuild.sh
# Download new files:
###########
db.sh solve first problem and rebuild.sh solve second and third problems ( backup restauration )
Why no pull request ?
Not is most elegant solution, working fine for now, save passwords and restore it, but I think vesta team will do better job for this and rebuild some esential functions to do better support for new mysql versions.
Cat this break something ?
I dont think ( only test this in ubuntu 16.04 ), but whitout patch you not store passwords, always you can revert patch just delete files and mv back older ones.
How to test y you afected by bug ?
As you can see no MD5 string was added:
When working
How can solve empty md5 value ?
Solved in next responwe -> viewtopic.php?f=20&t=13239#p53622
When you restore backup in mysql 5.7 you can run from mysql cli
SELETC user FROM mysql.users;
Then you can check your user was not restored.
This is reported also here: https://github.com/serghey-rodin/vesta/issues/959
All code changes and recomendations are accepted.
As always I say sorry for my bad english and a lot of mistakes in my write.
If you use ubuntu 16.04 or use mysql 5.7 whit vestacp I strongly recomended you apply this temporary patch until vesta team deploy official one.
Why this is critital if all working fine ?
Vesta fail when store mysql password into user/db.conf on mysql 5.7+ so you can create 100 databases / users today and tomorrow whant transfer to orther server or just backup it, whit default install your password not get saved
This work only whit mysql 5.7.6+ earlier versions of 5.7 like 5.7.5 may not work.
The problem cause this 3 bad problems:
1- Your password not stored in user/db.conf so when you make a databases backup you not backup your actual mysql user password.
2- If you not backup you cant restore it in your server or in others servers.
3- Also fail rabuild function when you try restore mysql database from orther server whit correct db.conf it cant restore it because rebuild function isnt prepared for mysql 5.7
So you can apply patch :
Login in your server as root->
##########
Code: Select all
cd /usr/local/vesta/func
Code: Select all
mv db.sh db-bk.sk
mv rebuild.sh rebuild-bk.sh
Code: Select all
wget https://raw.githubusercontent.com/Skamasle/vesta/master/func/db.sh
wget https://raw.githubusercontent.com/Skamasle/vesta/master/func/rebuild.sh
Code: Select all
chmod +x db.sh rebuild.sh
db.sh solve first problem and rebuild.sh solve second and third problems ( backup restauration )
Why no pull request ?
Not is most elegant solution, working fine for now, save passwords and restore it, but I think vesta team will do better job for this and rebuild some esential functions to do better support for new mysql versions.
Cat this break something ?
I dont think ( only test this in ubuntu 16.04 ), but whitout patch you not store passwords, always you can revert patch just delete files and mv back older ones.
How to test y you afected by bug ?
Code: Select all
cat /usr/local/vesta/data/users/YOURUSER/db.conf
Code: Select all
DB='test2_3' DBUSER='test2_3' MD5='' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='1' SUSPENDED='no' TIME='22:26:16' DATE='2016-11-28'
DB='test2_d' DBUSER='test2_d' MD5='*CC2AADF4E7EC1C90E7136D2B3B9D14F3CD' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='1' SUSPENDED='no' TIME='22:26:16' DATE='2016-11-28'
DB='test2_t' DBUSER='test2_t' MD5='' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='1' SUSPENDED='no' TIME='22:26:16' DATE='2016-11-28'
DB='test2_test3' DBUSER='test2_43' MD5='' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='1' SUSPENDED='no' TIME='22:26:16' DATE='2016-11-28'
DB='test2_x' DBUSER='test2_x' MD5='*196BDEDE2AE4F84CA44C47D54D78478C7E2' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='1' SUSPENDED='no' TIME='22:26:16' DATE='2016-11-28'
Code: Select all
MD5=''
Code: Select all
MD5='*196BDEDE2AE4F84CA44C47D54D78478C7E2'
Solved in next responwe -> viewtopic.php?f=20&t=13239#p53622
When you restore backup in mysql 5.7 you can run from mysql cli
SELETC user FROM mysql.users;
Then you can check your user was not restored.
This is reported also here: https://github.com/serghey-rodin/vesta/issues/959
All code changes and recomendations are accepted.