Typing a password straight into a command, like mysql -p'secret', happens. That line now sits in your history and, when the shell closes, in ~/.bash_history.
Find its number, then delete that entry:
history | tail -5
# 1041 ls
# 1042 mysql -u root -p'secret'
# 1043 history | tail -5
history -d 1042
Bash 5 also takes a range, like history -d 1040-1042, and negative numbers that count from the end. With negative numbers the history -d command itself counts as the newest line, so I find a plain positive number from the list safer.
This changes the list in memory. If the session already wrote its history to the file, for example with history -a in your prompt, the line is in ~/.bash_history as well. Rewrite the file from memory with history -w, or edit the file in a text editor.
Deleting it from history does not undo the leak. The password may also have been visible in ps output while the command ran, so change it if other people use that machine. For next time, a space at the start of a command with HISTCONTROL=ignorespace keeps it out of history from the start.
Further reading: Bash manual: Bash History Builtins