mysql

Can’t access remote MySQL

I got a VPS with CentOS, the only thing I have done is install MySQL for testing purposes.
When trying to connect from my pc I got this:
mysql -u root -p -h [REMOTE-IP]
Enter password:
ERROR 1045 (28000): Access denied for user ‘root’@’f…

Mysql find similar string [closed]

I have always wondered, what is the query for finding the most similar string in DB When I search for a word and get back the most similar string. How to do it in MYSQL? Here is an example of a site that works this way

How do I combine these tables?

My goal is to have a 5 by 5 table that looks like this:

State
MostRE
MostNRE
LeastRE
LeastNRE

WA
4499698
blank
blank
blank

TX
blank
91590135
blank
blank

DC
blank
blank
4780
blank

DC
blank
blank
blank
438130

I have found t…

Mysql enum field problems

in a mysql table I have a field of type Enum (‘S’, ‘N’) with default value = S. Now I have checked this table and I find many records that have no value in this field. How is it possible? I wanted to force the values of this field to be on…

Mysql enum field problems

in a mysql table I have a field of type Enum (‘S’, ‘N’) with default value = S. Now I have checked this table and I find many records that have no value in this field. How is it possible? I wanted to force the values of this field to be on…

MySQL monthly sums

I have a table transactions like this

date
amount

2020-02-26
1000

2020-02-26
1500

2021-01-11
200

I want to select the sum of all transactions per month. The result should look something like…

month
sum

2020-02
250…