المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : السي بانال WHM/cPanel رفع قاعدة بيانات من خلال الشل import a Database Over SSH



Rise Company
28-12-2023, 02:11
السي بانال WHM/cPanel رفع قاعدة بيانات من خلال الشل import a Database Over SSH
MariaDB error 1044 – Fix it now - cpanel restore db error 1044
Importing a database using SSH - Not able to import MySQL database using SSH
Error When Importing Database via SSH - SSH Importing a database
ssh import database password wrong - How to Import MySQL Databases in Command Line
حل مشكلة cpmove_failed_mysql_dbs

https://www.rise.company/upload/uploads/170372199058811.png

المشكلة :

اثناء نقل موقع من سيرفر الى اخر قد يفشل نقل قاعدة البيانات وهتجدها مخزنة فى FIlemanager
داخل فولدر cpmove_failed_mysql_dbs بداخلها قواعد البيانات التى فشل نقللها
او اذا كنت تريد رفع قاعدة بيانات كبيرة الحجم هتلجا الى الشل SSH

we will go over the steps on how to import MySQL databases within your command line interface. Using this method is just as easy as importing via the PHPMyAdmin software. However, the command line interface is preferred when you need to import SQL files over 50MB.

حل المشكلة :

من داخل Cpanel فى mesaseva_forum قم بانشاء قاعدة بيانات بنفس الاسم
وكذلك username بنفس الاسم ثم اعطى له privilege وقم بربطهم ببعض
هنا باسورد اليوز هام الاحتفاظ به ثم افتح الشل من terminal
ثم اول امر ادخله هو ls لكى يظهر لك list المجلدات
ثم ثانى امر cd ثم فراغ ثم اسم المجلد للانتقال اليه
وعند الوصول داخل مجلد قاعدة البيانات
ادخل الامر import مع تغيير ما يلزم



mysql -p -u mesa_forum mesa_forum < mesa_forum.sql


ثم ادخال باسورد يوزر قاعدة البيانات ثم انتهى
اذهب الى php وتحقق من الجداول وافتحها لانك قد تجدها فارغة
اذا كنت قاعدة البيانات mariadb وهترفعها على mysql
قد يفشل !!!

------------------------------------------------
Importing a SQL Database via SSH



Make sure you have your database created (https://www.inmotionhosting.com/support/edu/cpanel/create-mysql-database/) and a user attached (https://www.inmotionhosting.com/support/edu/cpanel/create-database-user/) to it. Please remember to copy or write down the information as you will need it in step 5.
Upload your SQL file to the server by either using the File Manager (https://www.inmotionhosting.com/support/edu/cpanel/using-file-manager-in-cpanel/) or a FTP Client (https://www.inmotionhosting.com/support/website/ftp/configuring-your-site-in-filezilla/). It does not matter where you upload it, just remember its location as you will need it later in the steps.
Log into your server via SSH (https://www.inmotionhosting.com/support/server/ssh/how-to-login-ssh/).
Navigate to where you uploaded the .sql file. For example, if you uploaded the file to your public_html folder, you would run the following command:cd /home/userna5/public_html
Next, use the command below to import the database. Replace userna5_db with your cPanel username and database name, and replace userna5_user with your cPanel user and database user.mysql -p -u userna5_user userna5_db < yoursqlfile.sql
This will prompt you for a password, here you will enter the password you used when creating the MySQL user that is associated with the database.

Congratulations you have now imported your SQL file into your database. If you had any issues along the way please let us know by commenting below.

المرجع:
https://www.inmotionhosting.com/support/website/how-to-import-mysql-databases-in-command-line/
https://support.hostinger.com/en/articles/4664722-how-to-import-a-database-over-ssh-on-cpanel
https://bobcares.com/blog/mariadb-error-1044/