File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -622,6 +622,30 @@ EEWPDBPREFIX()
622622 fi
623623}
624624
625+ FIXMYSQLUSER16 ()
626+ {
627+ # Fix MySQL USER ERROR 1470 (HY000)
628+ MYSQLUSER16=$( echo -n $WPDBUSER | wc -c)
629+
630+ if [[ $MYSQLUSER16 > 16 ]]
631+ then
632+ echo MySQL Database Username $WPDBUSER = $MYSQLUSER16 & >> $INSTALLLOG
633+ REPLACEDOT16=$( echo $REPLACEDOT | cut -c1-16)
634+
635+ echo -e " \033[31mERROR 1470 (HY000): $WPDBUSER Is Too Long For MySQL Username\e[0m"
636+ # Turn Off Echo For Passwords
637+ stty echo
638+ read -p " Enter The MySQL Database Username [$REPLACEDOT16 ]: " WPDBUSER
639+
640+ if [[ $WPDBUSER = " " ]]
641+ then
642+ WPDBUSER=$REPLACEDOT16
643+ fi
644+
645+ fi
646+
647+ }
648+
625649EECREATEDATABASE ()
626650{
627651 # Create Database
@@ -635,12 +659,27 @@ EECREATEDATABASE()
635659 if [ $? -eq 0 ]
636660 then
637661 read -p " Enter The MySQL Database Username [$REPLACEDOT ]: " WPDBUSER
662+
663+ if [[ $WPDBUSER = " " ]]
664+ then
665+ WPDBUSER=$REPLACEDOT
666+ fi
667+
668+ # Fix MySQL USER ERROR 1470 (HY000)
669+ FIXMYSQLUSER16
670+
671+ # Turn Off Echo For Passwords
672+ stty -echo
638673 read -p " Enter The MySQL Database Password [$WPDBRANDOMPASS ]: " WPDBPASS
674+ stty echo
675+ echo
639676 fi
640677
641678 if [[ $WPDBUSER = " " ]]
642679 then
643680 WPDBUSER=$REPLACEDOT
681+ # Fix MySQL USER ERROR 1470 (HY000)
682+ FIXMYSQLUSER16
644683 fi
645684
646685 if [[ $WPDBPASS = " " ]]
You can’t perform that action at this time.
0 commit comments