Changeset 1914
- Timestamp:
- 08/27/07 18:33:31 (9 months ago)
- Files:
-
- alternc/trunk/install/mysql.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
alternc/trunk/install/mysql.sh
r1880 r1914 43 43 mysql="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf -h$sqlserver " 44 44 45 if ! $mysql mysql -e "SHOW TABLES" >/dev/null46 then47 # is this an upgrade then?48 mysql="/usr/bin/mysql -h$sqlserver -u$rootlogin -p$rootpass"49 if ! $mysql mysql -e "SHOW TABLES" >/dev/null50 then51 echo "Can't get proper credentials, aborting"52 exit 153 fi54 fi55 56 45 # The grant all is the most important right needed in this script. 57 46 # If this call fail, we may be connected to a mysql-server version 5.0. 58 47 echo "Granting users " 59 # In that case, change mysql parameters and retry. Use root / nopassword.48 # In that case, change mysql parameters and retry. Use root / nopassword. 60 49 $mysql -e "GRANT ALL ON *.* TO '$rootlogin'@'${MYSQL_CLIENT}' IDENTIFIED BY '$rootpass' WITH GRANT OPTION" 61 50 if [ "$?" -ne "0" ] 62 51 then 63 echo "You are using mysql 5.0, so we try with root account and no password since debian-sys-maint doesn't work." 64 mysql="/usr/bin/mysql -h$sqlserver -uroot " 65 echo "Granting users " 52 echo "debian-sys-maintainer doesn't have the right credentials, assuming we're doing an upgrade" 53 mysql="/usr/bin/mysql -h$sqlserver -u$rootlogin -p$rootpass" 66 54 $mysql -e "GRANT ALL ON *.* TO '$rootlogin'@'${MYSQL_CLIENT}' IDENTIFIED BY '$rootpass' WITH GRANT OPTION" 67 55 if [ "$?" -ne "0" ] 68 56 then 69 echo "Can't grant system user $rootlogin, abording"; 70 exit 1 57 echo "Still not working, assuming clean install and empty root password" 58 mysql="/usr/bin/mysql -h$sqlserver -uroot " 59 $mysql -e "GRANT ALL ON *.* TO '$rootlogin'@'${MYSQL_CLIENT}' IDENTIFIED BY '$rootpass' WITH GRANT OPTION" 60 if [ "$?" -ne "0" ] 61 then 62 echo "Can't grant system user $rootlogin, abording"; 63 exit 1 64 fi 71 65 fi 72 66 fi
