Bassem Magdy - Media Buyer
Bassem Magdy - Media BuyerJul 28
Tech

طريقه انشاء قاعده بيانات لموقع الكتروني

2 min video3 key momentsWatch original
TL;DR

Bassem shows how to create a database for a website by connecting local PHP settings to online hosting through cPanel's Database Wizard.

Key Insights

1

Names change onlineDatabase names differ between local (localhost) and online — local uses underscores like 'landing_page_db', but online names derive from your cPanel username or domain.

2

Keep credentials consistentIn cPanel's Database Wizard, you enter the same username and password you used locally to avoid confusion and prevent accidentally deleting your own database.

Want this for every new video Bassem Magdy - Media Buyer posts? Brevyd summarizes each upload automatically, the morning it drops.

Deep Dive

Config file stores connection details

Bassem reminds viewers that the config file opened in Visual Studio holds all the connection info. On Windows localhost setups, you'll find root user with an empty password. On Mac, the user is root with password root. The key variable here is the database name — whatever you named it in phpMyAdmin locally. This is the foundation for understanding what needs to change when you go live.

Database names must change for online hosting

When you move to an online server, the database name can't stay the same as your local version. Instead, cPanel forces you to use a name derived from your domain or your cPanel username. Bassem gives an example: if your cPanel user is 'basem_my', the new database name becomes 'basem_my_db'. This isn't arbitrary — it's cPanel's naming convention to avoid conflicts across users on shared hosting.

Creating the database in cPanel Database Wizard

Head to cPanel and find Database Wizard. Enter your new database name following cPanel's rules. When prompted for username and password, use the same credentials from your local config file — this keeps things simple and prevents you from accidentally locking yourself out. Once you hit next, the database is created but empty, ready to receive your data. Copy the exact credentials to match your config file on the live server.

Takeaways

  • When migrating to live hosting, update your config file's database name to match cPanel's naming scheme, but keep the username and password identical to your local setup.
  • Use cPanel's Database Wizard to create databases on shared hosting — never try to bypass its naming conventions or you'll conflict with other users.

Key moments

0:14Windows vs Mac credentials differ

في الويندوز هتلاقي اليوزر روت والباسورد بتبقى فاضيه قلت لك لو شغال على الماك هتلاقي اليوزر روت والباسورد روت

0:57Online database names must change

الاونلاين اسم الداتابيز ما بيكونش كده بيبقى مشتق من اسم الدومين بتاعك او من اسم اليوزر نيم بتاع السي بانل

1:30Use Database Wizard in cPanel

هتلاقي عندك هنا حاجه اسمها داتابيز ويزرد هدوس عليها

You just read one. Brevyd does this for every upload.

Follow Bassem Magdy - Media Buyer and every new video comes back as a summary like this, in your morning briefing. No watching required.