<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 24, 2020 at 8:27 PM Bill Meek <<a href="mailto:keemllib@gmail.com">keemllib@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 3/24/20 7:01 PM, James Abernathy wrote:<br>
> On Tue, Mar 24, 2020 at 7:59 PM James Abernathy <<a href="mailto:jfabernathy@gmail.com" target="_blank">jfabernathy@gmail.com</a>><br>
> wrote:<br>
> <br>
>><br>
>><br>
>> On Tue, Mar 24, 2020 at 7:22 PM Bill Meek <<a href="mailto:keemllib@gmail.com" target="_blank">keemllib@gmail.com</a>> wrote:<br>
>><br>
>>> On 3/24/20 3:44 PM, James Abernathy wrote:<br>
>>>>> I can login with the --default-extra-file<br>
>>>> The sudo dpkg-reconfigure mythtv-database didn't add much new text.<br>
>>>><br>
>>>> jim@mythbuntu:~$ sudo dpkg-reconfigure mythtv-database<br>
>>>> Failed to create/alter user or grant permissions to database (incorrect<br>
>>>> admin username/password?)<br>
>>>> Try:<br>
>>>> sudo dpkg-reconfigure mythtv-database<br>
>>><br>
>>> On line 42: mysql $SECURITY_INFO "$database" >/dev/null 2>&1;<br>
>>><br>
>>> remove the:<br>
>>><br>
>>>       >/dev/null<br>
>>><br>
>>> That should allow the SQL error to print.<br>
>>><br>
>>> The three queries (run as the MySQL root user) are:<br>
>>><br>
>>> CREATE USER IF NOT EXISTS 'mythtv'@'%' IDENTIFIED WITH<br>
>>> mysql_native_password;<br>
>>> ALTER USER 'mythtv'@'%' IDENTIFIED BY 'your password here';<br>
>>> GRANT ALL ON mythconverg.* TO 'mythtv'@'%';<br>
>>><br>
>>> --<br>
>>> Bill<br>
>>><br>
>> jim@mythbuntu:~$ sudo dpkg-reconfigure mythtv-database<br>
>> ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check<br>
>> the manual that corresponds to your MariaDB server version for the right<br>
>> syntax to use near 'IF NOT EXISTS 'mythtv'@'%' IDENTIFIED WITH<br>
>> mysql_native_password' at line 1<br>
>> Failed to create/alter user or grant permissions to database (incorrect<br>
>> admin username/password?)<br>
>> Try:<br>
>> sudo dpkg-reconfigure mythtv-database<br>
>> jim@mythbuntu:~$<br>
>><br>
> <br>
> If I run the command from the console I get this:<br>
> MariaDB [mysql]> CREATE USER IF NOT EXISTS 'mythtv'@'%' IDENTIFIED WITH<br>
> mysql_native_password;<br>
> ERROR 1064 (42000): You have an error in your SQL syntax; check the manual<br>
> that corresponds to your MariaDB server version for the right syntax to use<br>
> near 'IF NOT EXISTS 'mythtv'@'%' IDENTIFIED WITH mysql_native_password' at<br>
> line 1<br>
> MariaDB [mysql]><br>
<br>
You're on Server version: 10.0.36-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04.<br>
<br>
My MariaDB tests are on Server version: 10.3.22-MariaDB-0ubuntu0.19.10.1 Ubuntu 19.10.<br>
<br>
<a href="https://mariadb.com/kb/en/create-user/#if-not-exists" rel="noreferrer" target="_blank">https://mariadb.com/kb/en/create-user/#if-not-exists</a> says IF NOT EXISTS is OK<br>
for 10.3. Sounds like 10.0 doesn't support it.<br>
<br>
What happens if you do: CREATE USER 'blah'@'%'  IDENTIFIED WITH mysql_native_password;<br>
and then do it again?<br>
<br>
DROP USER blah; will get rid of the new user.<br>
<br>
-- <br>
Bill<br></blockquote><div><br></div>jim@mythbuntu:~$ sudo mysql -u root mysql<br>[sudo] password for jim: <br>Reading table information for completion of table and column names<br>You can turn off this feature to get a quicker startup with -A<br><br>Welcome to the MariaDB monitor.  Commands end with ; or \g.<br>Your MariaDB connection id is 1384<br>Server version: 10.0.36-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04<br><br>Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.<br><br>Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.<br><br>MariaDB [mysql]> CREATE USER 'blah'@'%' IDENTIFIED WITH mysql_native_password;<br>Query OK, 0 rows affected (0.04 sec)<br><br>MariaDB [mysql]> CREATE USER 'blah'@'%' IDENTIFIED WITH mysql_native_password;<br>ERROR 1396 (HY000): Operation CREATE USER failed for 'blah'@'%'<br>MariaDB [mysql]> <br><div><br></div><div>Jim A</div><div> </div></div></div>