duanba3707 2016-08-17 19:24
浏览 90
已采纳

从一个vps迁移到新的XAMPP Linux的问题

Now i'm getting this error when i try to go to "domain.com/admin"

A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: core/Loader.php

Line Number: 346

Also i should be able to use phpmyadmin using domain like "domain.com/phpmyadmin", but is not working with the new IP.

What i do:

  • Install same Xampp and configure security.

    sshadmin@ubuntu-512mb-nyc3-01:~$ sudo chmod +x xampp-linux-x64-7.0.8-0-installer.run [sudo] password for sshadmin: sshadmin@ubuntu-512mb-nyc3-01:~$ sudo ./xampp-linux-x64-7.0.8-0-installer.run ---------------------------------------------------------------------------- Welcome to the XAMPP Setup Wizard. ---------------------------------------------------------------------------- Select the components you want to install; clear the components you do not want to install. Click Next when you are ready to continue. XAMPP Core Files : Y (Cannot be edited) XAMPP Developer Files [Y/n] :y Is the selection above correct? [Y/n]: y ---------------------------------------------------------------------------- Installation Directory XAMPP will be installed to /opt/lampp Press [Enter] to continue: ---------------------------------------------------------------------------- Setup is now ready to begin installing XAMPP on your computer. Do you want to continue? [Y/n]: y ---------------------------------------------------------------------------- Please wait while Setup installs XAMPP on your computer. Installing 0% ______________ 50% ______________ 100% ######################################### ---------------------------------------------------------------------------- Setup has finished installing XAMPP on your computer. sshadmin@ubuntu-512mb-nyc3-01:~$ sudo /opt/lampp/lampp start Starting XAMPP for Linux 7.0.8-0... XAMPP: Starting Apache...already running. XAMPP: Starting MySQL...ok. XAMPP: Starting ProFTPD...ok. sshadmin@ubuntu-512mb-nyc3-01:~$ sudo /opt/lampp/lampp security XAMPP: Quick security check... XAMPP: Your XAMPP pages are NOT secured by a password. XAMPP: Do you want to set a password? [yes] yes XAMPP: Password: XAMPP: Password (again): /opt/lampp/share/xampp/checkapache: line 41: /opt/lampp/htdocs/xampp/.htaccess: No such file or directory cp: cannot stat '/opt/lampp/htdocs/xampp/.htaccess': No such file or directory cp: cannot stat '/opt/lampp/htdocs/xampp/.htaccess': No such file or directory chmod: cannot access '/opt/lampp/htdocs/xampp/.htaccess': No such file or directory chmod: cannot access '/opt/lampp/htdocs/webalizer/.htaccess': No such file or directory chmod: cannot access '/opt/lampp/phpmyadmin/.htaccess': No such file or directory XAMPP: Password protection active. Please use 'xampp' as user name! XAMPP: MySQL is accessable via network. XAMPP: Normaly that's not recommended. Do you want me to turn it off? [yes] yes XAMPP: Turned off. XAMPP: Stopping MySQL...ok. XAMPP: Starting MySQL...ok. XAMPP: The MySQL/phpMyAdmin user pma has no password set!!! XAMPP: Do you want to set a password? [yes] yes XAMPP: Password: XAMPP: Password (again): XAMPP: Setting new MySQL pma password. XAMPP: Setting phpMyAdmin's pma password to the new one. XAMPP: MySQL has no root passwort set!!! XAMPP: Do you want to set a password? [yes] yes XAMPP: Write the password somewhere down to make sure you won't forget it!!! XAMPP: Password: XAMPP: Password (again): XAMPP: Setting new MySQL root password. XAMPP: Change phpMyAdmin's authentication method. XAMPP: The FTP password for user 'daemon' is still set to 'xampp'. XAMPP: Do you want to change the password? [yes] yes XAMPP: Password: XAMPP: Password (again): XAMPP: Reload ProFTPD...ok. XAMPP: Done.

  • Copy with WinSCP the files from the old VPS to the new.

    /opt/lampp/domain.com

  • Edit /opt/lampp/etc/httpd.conf

    Include etc/extra/httpd-vhosts.conf

  • Edit /opt/lampp/etc/extra/httpd-vhosts.conf

    <VirtualHost *:80> DocumentRoot "/opt/lampp/domain.com/" ServerName dotaskapp.com </VirtualHost>

  • Edit /opt/lampp/etc/extra/httpd-xampp.conf

    <Directory "/opt/lampp/domain.com/">> AllowOverride All Order allow,deny allow from all Require all granted ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </Directory> <Directory "/opt/lampp/phpmyadmin"> AllowOverride AuthConfig Limit Require local Require ip myip ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </Directory> <Directory "/opt/lampp/phpsqliteadmin"> AllowOverride AuthConfig Limit Require local Require ip myip ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </Directory>

  • In browser: http://vpsIp/phpmyadmin/ and import data base.

  • Edit /etc/hosts

    127.0.0.1 domain.com

  • Restart xampp.

    /opt/lampp/lampp restart

Change the domain nameservers IP to the new VPS IP.

  • 写回答

1条回答 默认 最新

  • duanfu1942 2016-08-19 06:32
    关注

    To fix domain problem i change the nameservers, because my new VPS only accept their own nameservers.

    The problem with "Unable to connect to your database server using the provided settings.".

    Was fixed adding a new user with the same credentials in phpMyAdmin.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!