I don't know if I have mysql database on VPS

DaveGG2 years ago

Hello, a greeting, excuse me if I do not clarify myself with linux and vps in Oracle.
My problem is that I don't get placeholders after querying the live route, I suspect it may be because of the h2 DB, "I suspect, I don't assert it".
I will try to be clear but surely the more information the better for you to help me.
I installed traccar on Oracle VPS following several manuals, not the traccar manual, https://www.traccar.org/install-digitalocean/ ; (excuse this point).
Seeing this, where I want know is if I have mysql installed prior to traccar, (I don't remember how do installed), to enter the gps data to the mysql server, since I suspect that I do not have mysql and the h2 DB don't works good.
So far I have managed to figure out that in my /opt/traccar/conf/traccar.xml directory the enter keys are from h2. This is how it looks.

<entry key='database.driver'>org.h2.Driver</entry>
<entry key='database.url'>jdbc:h2:./data/database</entry>
<entry key='database.user'>sa</entry>
<entry key='database.password'></entry>

In summary. How can I tell if I have mysql installed on my Oracle instance? In what directory or with what simple Linux console command do I find out?
apt list --installed does not work.
Thanks, that's all for now.

control taken2 years ago

hey bro is easy, for search yes have mysql can use comand in the terminal * mysql --version

It is suggested that you read the documentation, it will not take much of your time, it is simple I would tell you but for your long-term sake I suggest that you look at the documentation, it is something basic.

https://www.traccar.org/mysql/

and you don't have traccar configured with your mysql database according to the configuration I provided you have h02

DaveGG2 years ago

Thanks @control taken.
Believe me, to me English and technical issues is so hard to understand.
I'll try all this more later, when have time and patient.
Thanks again.

DaveGG2 years ago

Hello again, after billion attempts to connect to ssh to my OCI I can see this

ubuntu@traccar-free:~$ mysql --version
mysql  Ver 8.0.30-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))

So. What need to do, create my database, user and pass? Because first I read in other site that first, need give make access from outside the machine with this.

[Mysqld]
skip-external-locking
bind-address = 0.0.0.0

Remember i'm in OCI and connect via ssh
See you!!

control taken2 years ago

Well technically I have never configured the vps for traccar in oracle because it is complex due to the firewall configurations you must open port for connections and also when you install the traccar, theoretically I would have to do that but since I have never done it I would not know how to tell you for these cases Since you are somewhat new to this, I suggest you buy a VPS at OVH, the truth is that they are very cheap, to start like you, I recommend the $4.20 2gm ram 1core 20ssd https://www.ovhcloud.com/es /vps/ I have 100GPS working with that hardware without any problem, obviously I have it optimized, I would recommend watching a short course on bash scrypting and administering vps on YouTube, although ovh provides quite simple documentation.

If you see that it is very complex for you, I would recommend hiring a person to configure a server for you, I could help you, but for reasons of rules in the forum, contact information cannot be shared, but I encourage you to search and learn. super fun and the versatility it gives you is impressive when it comes to correcting problems on your server that may arise

DaveGG2 years ago

But W.T.H, why doesn't anyone explain this? I have two traccar.xml, one in the root or /opt/traccar traccar.xml and another in /opt/conf/traccar.xml
The latter is empty. The other has mysql parameters

<string key="config.default">./conf/default.xml</string>
<string key='database.driver'>com.mysql.jdbc.Driver</string>
<string key='database.url'>jdbc:mysql://localhost/traccar?serverTimezone=UTC&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode= ''</string>
    <string key='database.user'>root</string>
    <string key='database.password'>root</string>

@control taken go to read you, thanks
Read about you post. I can say that my OCI firewall and rules are all pretty configured, and that is not problem, thanks mate.

control taken2 years ago

let me tell you the configuration file that traccar brings by default is located in the path /opt/traccar/conf/traccar.xml that is the path that brings the nistalar and must contain information about connections to the base h02 that is where you must place the mysql database information provided above https://www.traccar.org/mysql/

now in the route /opt/traccar/traccar.xml which is found to be empty, at least the one created by those trying to access the previous route since by default traccar does not bring this route /opt/traccar/traccar.xml but the The only path that comes by default where you must enter the configuration information of your traccar service is in the path /opt/traccar/conf/traccar.xml so that path which has no information can be deleted since it is not the one that comes by default and where should not put information

control taken2 years ago

I will provide you with the following list of commands so that you can create your database without problems

mysql -u root -p

password: YOUR__PASSWORD

CREATE DATABASE(NAMEDATABASE);
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON traccarDB.* TO 'user'@'localhost';
FLUSH PRIVILEGES;
exit;

I will also provide you with an example how you should create it if you didn't understand.

mysql -u root -p

password: yourpassword

CREATE DATABASE traccarDB;
CREATE USER 'david'@'localhost' IDENTIFIED BY 'david1234';
GRANT ALL PRIVILEGES ON traccarDB.* TO 'david'@'localhost';
FLUSH PRIVILEGES;
exit;
control taken2 years ago

I hope it helps you, and I'll leave the message in case Anton reads the message, I forgot to put the back ticks in the lines of code to differentiate it, so it won't happen again: S I noticed after I published my comment on the topic

DaveGG2 years ago

Thank you very much @control taken.
I'll try all of this after.
Thnks

DaveGG2 years ago

One detail, if I name my database

CREATE DATABASE MyTraccarDB;

in the fiel

GRANT ALL PRIVILEGES ON 

I need write or call it ? MyTraccarDB.*

DaveGG2 years ago

Sorry

mysql -u root -p
Access denied for user 'root'@'localhost' (using password: YES)
Access denied for user 'root'@'localhost' (using password: NO)

when I don't write my ubuntu pass
And I finish my internet bono to 18th October

DaveGG2 years ago

Fix it, are root
But

CREATE: command not found
CREATE: command not found
GRANT: command not found
FLUSH: command not found
logout

todo esto me aburre!

DaveGG2 years ago

I again.
I bought an internet voucher.
€1 - 1GB, so expensive.
What is the difference betwing this?

mysql -u root -p
CREATE DATABASE myNewDB;
CREATE USER 'user'@'localhost' IDENTIFIED BY 'psw?';
GRANT ALL PRIVILEGES ON myNewDB.* TO 'user'@'localhost';
FLUSH PRIVILEGES;
exit;

and this?

mysql -u root --execute="ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES; CREATE DATABASE traccar;"

why the first case is broken?

CREATE: command not found
CREATE: command not found
GRANT: command not found
FLUSH: command not found
logout
DaveGG2 years ago

After some internal works I can obtained advances, but not without problems...

mysql> CREATE DATABASE mytraccarDB;
Query OK, 1 row affected (0.51 sec)

mysql> CREATE USER 'david'@'localhost' IDENTIFIED BY '???????';
ERROR 1396 (HY000): Operation CREATE USER failed for 'david'@'localhost'
mysql> GRANT ALL PRIVILEGES ON mytraccarDB.* TO 'david'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> exit

ERROR 1396 (HY000) user failed david.
Maybe need change it in traccar/conf/traccar.xml replace user, (user root to david?)