Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Danny971's avatar

out of 31 tables in the database two wont be deploy or created only 29 does

im trying to get all my 31 tables to be deployed on gcp compute engine. i have sucessfully exported the database from phpmyadmin on my local machine and received the .sql file I have also uploaded it to the cloud (.sql file)

from the mysql command line i tried to uploade the sql file using this command

USE test_db;
SOURCE /var/my_db.sql ;

29 tables were uploaded/deploy/created 
2 were not 
I get this error

ERROR 1146 (42S02): Table 'test_db.backorder' doesn't exist
ERROR 1146 (42S02): Table 'test_db.client_data' doesn't exist

but when i use cat test_db

i saw the code that creates these two table .

my question is my does it work for the 29 other tables and not these two
0 likes
29 replies
Tray2's avatar

To me it looks like you exported two schemas, and only have one schema in the cloud server. I guess that if you run create database test_db; and run the SQL file again, it would import everything, but you need to ask yourself, should the test_db exist in the cloud server.

Tray2's avatar
Tray2
Best Answer
Level 73

@Danny971 And you have created those to tables? If not try creating them manually then import the data.

Danny971's avatar

@Tray2 I created the tables on my local machine with phpmyadmin and mysql workbench. I exported the database from phpmyadmin and then uploaded the .sql file to compute engine

Danny971's avatar

@Tray2 you mean like create them from the sql command line on the cloud

Danny971's avatar

@Tray2 I could try but I'm trying to understand why they were not created

Danny971's avatar

@Tray2 I did that and it's like any other normal table that was deployed

Danny971's avatar

@Tray2 yes do you want to do a team viewer or zoom session with me so I can explain it better maybe you will understand better

Tray2's avatar

@Danny971 It's you who don't understand, if the database tells you the table doesn't exist, it doesn't exist, as to why it doesn't exist is anyones guess as long as you don't share the SQL that you have dumped.

I recommend creating proper migration files and seeders instead of exporting and importing from the command line.

Danny971's avatar

@Tray2 I will upload the code here . The two that doesn't work and at Keats two that works from the .sql file

Danny971's avatar

@Tray2 here is the code that creates the client_data in the my_db.sql

-- --------------------------------------------------------

--
-- Table structure for table `client_data`
--

CREATE TABLE `client_data` (
  `id` int(11) NOT NULL,
  `family_id` int(11) NOT NULL,
  `client_file` blob NOT NULL,
  `created_at` date NOT NULL DEFAULT current_timestamp(),
  `updated_at` date NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `client_data`
--

and also here is for backorder 

--
-- Table structure for table `backorder`
--

CREATE TABLE `backorder` (
  `id` int(11) NOT NULL,
  `family_id` int(11) NOT NULL,
  `product_name` varchar(40) NOT NULL,
  `qty` int(11) NOT NULL,
  `product_description` text NOT NULL,
  `product_category` varchar(20) NOT NULL,
  `created_at` date NOT NULL DEFAULT current_timestamp(),
  `updated_at` date NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

-- --------------------------------------------------------


Danny971's avatar

@Tray2 same as the above two but different names and different column names

Danny971's avatar

@Tray2 code of the tables that work and successfully created and deployed?

Danny971's avatar

@Tray2 I don't feel comfortable posting it here how about we set a zoom or TeamViewer session ?

Tray2's avatar

@Danny971

I suggest that you take a look in your script to make sure that you create all tables before trying to insert any data into the tables.

DDL first and then DMl.

Danny971's avatar

@Tray2 that's the way I did it I created the tables first and then insert later

Danny971's avatar

@Tray2 i went on a re create the table from the mysql command line

1 like

Please or to participate in this conversation.