, если вы меняете файлы в / var / lib / mysql [например, копируете или заменяете это], вы должны установить владельца файлов в mysql, это так важно, если перезапуск mariadb.service был неудачным
chown -R mysql: mysql / var / lib / mysql / *
chmod -R 700 / var / lib / mysql / *
blockquote>
Вы запрашиваете новый ввод и записываете его перед тем, как записать первый действительный ввод в файл. Вместо этого сначала напишите правильный ввод, а затем запросите ввод.
outfile = open("userInput.txt","w")
userInput = int(input("Enter a number to the text file: "))
count = 0
while(userInput != -1)
outfile.write(str(userInput) + "\n")
userInput = int(input("Enter a number to the text file: "))
count+=1
if count == 0:
print("There is no numbers in the text file")
outfile.write("There is no numbers in the text file")
outfile.close()
Это должно работать.