Can I connect to a Raspberry Pi running sqlite from my PC on the same network?

dynamicdave's profile image dynamicdave posted 2 years ago in General Permalink

I'm sorry if this question has been asked before - I couldn't find it on the Forum.

I'm trying to connect to an 'sqlite3' database running on a Raspberry Pi on my home network from my PC which is running Heidi on the same network. My first question is this possible? And if it is, has anyone got an example of how to do it? I can connect to a remote server running MySQL on my ISP so I know the connection is good.

Kind regards, David.

ansgar's profile image ansgar posted 2 years ago Permalink

You will need to access the SQLite file from HeidiSQL. It should be sufficient to have some smb share or similar on the raspi.

dynamicdave's profile image dynamicdave posted 2 years ago Permalink

Thanks for the swift response. I've now setup samba on my Pi and can access the file structure from my PC. Can I ask which Network Type I select in the Heidi dropdown?

dynamicdave's profile image dynamicdave posted 2 years ago Permalink

I've made progress and can now connect Heidi to the sqlite dB on my Raspberry Pi. If I try to insert a new row I get this error. I've checked the file permissions on the dB and they are RWX (775) Any suggestions?

1 attachment(s):
  • Screen-Shot-10-29-21-at-03.25-PM
ansgar's profile image ansgar posted 2 years ago Permalink

According to this thread, the database file may be encrypted. Or it's already opened in another process?

dynamicdave's profile image dynamicdave posted 2 years ago Permalink

I've made further progress and managed to get Heidi to connect to a sqlite db on a remote Raspberry Pi on my home network. I can open a new or an existing table and Add new column and Save the table away. However, if I try to Remove a column and then try to Save the table I get this error message.

1 attachment(s):
  • Screen-Shot-10-30-21-at-05.32-PM
dynamicdave's profile image dynamicdave posted 2 years ago Permalink

I think I've found the answer - You cannot use the ALTER TABLE statement to drop a column in a table. Instead you will need to rename the table, create a new table, and copy the data into the new table.

Obviously this is a lot different to MYsql where you can do things like that.

Is that correct or have I misunderstood something?

ansgar's profile image ansgar posted 2 years ago Permalink

Yes that may be the case. HeidiSQL's DDL queries in the table editor do not support SQLite.

Please login to leave a reply, or register at first.